Add display of context when input was generated

Not sure if I did this right but it does move with the conversation and seems to match value.
This commit is contained in:
Forkoz 2023-03-24 08:56:07 -05:00 committed by GitHub
parent 4f5c2ce785
commit b740c5b284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,5 +270,5 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi
traceback.print_exc() traceback.print_exc()
finally: finally:
t1 = time.time() t1 = time.time()
print(f"Output generated in {(t1-t0):.2f} seconds ({(len(output)-len(original_input_ids[0]))/(t1-t0):.2f} tokens/s, {len(output)-len(original_input_ids[0])} tokens)") print(f"Output generated in {(t1-t0):.2f} seconds ({(len(output)-len(original_input_ids[0]))/(t1-t0):.2f} tokens/s, {len(output)-len(original_input_ids[0])} tokens, context {len(original_input_ids[0])})")
return return