From 370e2f9e5bbe59912644b1b6e052e17be31d6858 Mon Sep 17 00:00:00 2001 From: Jan Kaniecki Date: Tue, 21 Jan 2025 17:55:23 +0100 Subject: [PATCH] Fix max_tokens handling in vllm_vlms.py (#2637) * Update vllm_vlms.py * pre-commit --------- Co-authored-by: Baber --- lm_eval/models/vllm_vlms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lm_eval/models/vllm_vlms.py b/lm_eval/models/vllm_vlms.py index ab216ab59d..a0d72926c4 100644 --- a/lm_eval/models/vllm_vlms.py +++ b/lm_eval/models/vllm_vlms.py @@ -271,7 +271,9 @@ def _collate(x): left_truncate_len=max_ctx_len, ) - cont = self._model_generate(inputs, stop=until, generate=True, **kwargs) + cont = self._model_generate( + inputs, stop=until, generate=True, max_tokens=max_gen_toks, **kwargs + ) for output, context in zip(cont, contexts): generated_text = output.outputs[0].text