mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 09:21:18 +08:00
fix for empty initial string (#665)
This commit is contained in:
parent
c386dd5f5a
commit
1e2f7f50b6
@ -249,7 +249,9 @@ def generate(
|
||||
|
||||
if verbose:
|
||||
s = tokenizer.decode(tokens)
|
||||
if formatter:
|
||||
if not s:
|
||||
continue
|
||||
elif formatter:
|
||||
formatter(s[skip:], prob.item())
|
||||
skip = len(s)
|
||||
elif s[-1] != REPLACEMENT_CHAR:
|
||||
|
Loading…
Reference in New Issue
Block a user