mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
feat: show batch generation progress
This commit is contained in:
parent
280b3784d4
commit
2caa8329c0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user