feat: show batch generation progress

This commit is contained in:
L Lllvvuu 2024-08-23 16:27:50 +09:00
parent 280b3784d4
commit 2caa8329c0
No known key found for this signature in database
GPG Key ID: CFAD5A25056DDD0F

View File

@ -375,6 +375,8 @@ def generate(
break
if is_batch:
output_toks.append(tokens)
if verbose:
print(".", end="", flush=True)
else:
token = tokens.item()
logprobs = logprobs.squeeze(0)
@ -404,6 +406,7 @@ def generate(
if token_count <= 0:
print("No tokens generated for this prompt")
if is_batch:
print()
for p, resp in zip(prompt, response):
print("=" * 10)
print("Prompt:", p)