mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 01:17:28 +08:00
fix generation evaluations (#1277)
This commit is contained in:
parent
3d677f0870
commit
e879ea70e1
@ -295,7 +295,9 @@ class MLXLM(LM):
|
||||
completions = []
|
||||
|
||||
for context, until in tqdm(zip(contexts, untils), total=len(contexts)):
|
||||
context = self._tokenize(context)
|
||||
context = self.tokenizer.encode(
|
||||
context, add_special_tokens=not self.use_chat_template
|
||||
)
|
||||
max_tokens = min(
|
||||
self._max_tokens,
|
||||
self.tokenizer.model_max_length - len(context),
|
||||
|
Loading…
Reference in New Issue
Block a user