fix generation evaluations (#1277)

This commit is contained in:
Awni Hannun 2025-02-11 16:10:30 -08:00 committed by GitHub
parent 3d677f0870
commit e879ea70e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),