Skip to content

Commit 266f009

Browse files
author
Mug
committed
Dont write a prompt on KeyboardInterrupt if in instruct mode
1 parent 754e6bf commit 266f009

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/low_level_api_chatllama_cpp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,5 +285,6 @@ def inp():
285285
for i in m.output():
286286
print(i,end="",flush=True)
287287
except KeyboardInterrupt:
288-
print(f"\n{USER_NAME}:",end="")
289-
m.input(f"\n{USER_NAME}:")
288+
if not m.instruct:
289+
print(f"\n{USER_NAME}:",end="")
290+
m.input(f"\n{USER_NAME}:")

0 commit comments

Comments
 (0)