fix for stop sequence missing, added print for exception when loading GUI
This commit is contained in:
parent
0703cdf2eb
commit
433fa1e8b2
1 changed files with 8 additions and 6 deletions
14
koboldcpp.py
14
koboldcpp.py
|
@ -162,11 +162,12 @@ def generate(prompt,max_length=20, max_context_length=512,temperature=0.8,top_k=
|
|||
inputs.rep_pen = rep_pen
|
||||
inputs.rep_pen_range = rep_pen_range
|
||||
inputs.seed = seed
|
||||
for n in range(0,stop_token_max):
|
||||
if n >= len(stop_sequence):
|
||||
inputs.stop_sequence[n] = "".encode("UTF-8")
|
||||
else:
|
||||
inputs.stop_sequence[n] = stop_sequence[n].encode("UTF-8")
|
||||
if stop_sequence:
|
||||
for n in range(0,stop_token_max):
|
||||
if n >= len(stop_sequence):
|
||||
inputs.stop_sequence[n] = "".encode("UTF-8")
|
||||
else:
|
||||
inputs.stop_sequence[n] = stop_sequence[n].encode("UTF-8")
|
||||
ret = handle.generate(inputs,outputs)
|
||||
if(ret.status==1):
|
||||
return ret.text.decode("UTF-8","ignore")
|
||||
|
@ -501,8 +502,9 @@ def main(args):
|
|||
print("Otherwise, please manually select ggml file:")
|
||||
try:
|
||||
show_gui()
|
||||
except Exception as ex:
|
||||
except Exception as ex:
|
||||
print("File selection GUI unsupported. Please check command line: script.py --help")
|
||||
print("Reason for no GUI: " + str(ex))
|
||||
time.sleep(2)
|
||||
sys.exit(2)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue