Merge pull request #538 from Ph0rk0z/display-input-context

Add display of context when input was generated
This commit is contained in:
oobabooga 2023-03-25 11:56:18 -03:00 committed by GitHub
commit a1f12d607f
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