Skip to content

Commit

Permalink
copy and truncate the last 6 of them
Browse files Browse the repository at this point in the history
  • Loading branch information
YerongLi committed Jul 4, 2023
1 parent e967bbb commit 6b12b1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main():
model.eval()


history = []
history = buffered_history.copy()
print(welcome)
while True:
try:
Expand All @@ -75,13 +75,13 @@ def main():
if query.strip() == "stop":
break
if query.strip() == "clear":
history = []
history = buffered_history.copy()
os.system(clear_command)
print(welcome)
continue

count = 0
for _, history in model.stream_chat(tokenizer, query, history=([random.sample(buffered_history,3)] + history[:-3])[:-6], **generating_args.to_dict()):
for _, history in model.stream_chat(tokenizer, query, history=history[:-6], **generating_args.to_dict()):
if stop_stream:
stop_stream = False
break
Expand Down

0 comments on commit 6b12b1e

Please sign in to comment.