Flush output every token in generate_completions.py (#73)

This commit is contained in:
LoganDark 2023-05-26 05:23:58 -07:00 committed by GitHub
parent 83983bbb84
commit b61d94aef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ for GENERATION in range(generation_count):
for i in range(tokens_per_generation): for i in range(tokens_per_generation):
token = sampling.sample_logits(logits, temperature, top_p) token = sampling.sample_logits(logits, temperature, top_p)
print(tokenizer.decode([token]), end='') print(tokenizer.decode([token]), end='', flush=True)
logits, state = model.eval(token, state, state, logits) logits, state = model.eval(token, state, state, logits)