Skip to content

Commit 370e2f9

Browse files
jkanieckibaberabb
andauthored
Fix max_tokens handling in vllm_vlms.py (EleutherAI#2637)
* Update vllm_vlms.py * pre-commit --------- Co-authored-by: Baber <[email protected]>
1 parent b2c090c commit 370e2f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lm_eval/models/vllm_vlms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ def _collate(x):
271271
left_truncate_len=max_ctx_len,
272272
)
273273

274-
cont = self._model_generate(inputs, stop=until, generate=True, **kwargs)
274+
cont = self._model_generate(
275+
inputs, stop=until, generate=True, max_tokens=max_gen_toks, **kwargs
276+
)
275277

276278
for output, context in zip(cont, contexts):
277279
generated_text = output.outputs[0].text

0 commit comments

Comments
 (0)