Skip to content

Commit e59bc73

Browse files
committed
Update process_management.py
1 parent f2679ac commit e59bc73

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

app/lib/endpoints/process_management.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,18 @@ async def start_cli_chat_process(
108108
'-t', str(threads),
109109
'-c', str(ctx_size),
110110
'-n', str(n_predict),
111-
'--temp', str(temperature),
112-
'--repeat-penalty', str(repeat_penalty),
113-
'--top-k', str(top_k),
114-
'--top-p', str(top_p),
115111
]
116-
112+
113+
# Only add optional arguments if they are not None or blank
114+
if temperature is not None and str(temperature) != '':
115+
command.extend(['--temp', str(temperature)])
116+
if repeat_penalty is not None and str(repeat_penalty) != '':
117+
command.extend(['--repeat-penalty', str(repeat_penalty)])
118+
if top_k is not None and str(top_k) != '':
119+
command.extend(['--top-k', str(top_k)])
120+
if top_p is not None and str(top_p) != '':
121+
command.extend(['--top-p', str(top_p)])
122+
117123
if system_prompt:
118124
command.extend(['-p', system_prompt])
119125

0 commit comments

Comments
 (0)