File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments