Skip to content

Commit

Permalink
Using prompt_toolkit for chat interface
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumLiu committed Feb 22, 2023
1 parent eebbe90 commit b113b32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
np.set_printoptions(precision=4, suppress=True, linewidth=200)
args = types.SimpleNamespace()

from prompt_toolkit import prompt

print('\n\nChatRWKV project: https://github.com/BlinkDL/ChatRWKV')

########################################################################################################
Expand Down Expand Up @@ -427,7 +429,7 @@ def on_message(message):
print(f'Ready - {CHAT_LANG} {args.RUN_DEVICE} {args.FLOAT_MODE} QA_PROMPT={QA_PROMPT} {args.MODEL_NAME}\n')

while True:
msg = input(f'{user}{interface} ')
msg = prompt(f'{user}{interface} ')
if len(msg.strip()) > 0:
on_message(msg)
else:
Expand Down

0 comments on commit b113b32

Please sign in to comment.