mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-31 11:54:37 +08:00
nist
This commit is contained in:
parent
3f750759d3
commit
7da89adef8
@ -32,7 +32,7 @@ class PromptLookupDecoder:
|
||||
x = sample(logits)
|
||||
yield x
|
||||
|
||||
# Generate without prompt lookup decoding (for testing)
|
||||
# Normal decoding w/o prompt lookup (for testing)
|
||||
def generate(
|
||||
self,
|
||||
prompt,
|
||||
@ -140,10 +140,11 @@ class PromptLookupDecoder:
|
||||
|
||||
n_decoding_steps += 1
|
||||
|
||||
# Check stop decodig criteria:
|
||||
# Check stop decodig criteria and print accepted draft tokens.
|
||||
for t in new_tokens.tolist()[:-1]:
|
||||
if t == self.tokenizer.eos_id:
|
||||
break
|
||||
|
||||
if color:
|
||||
print(
|
||||
"\033[34m" + self.tokenizer.decode([t]) + "\033[30m",
|
||||
|
Loading…
Reference in New Issue
Block a user