Skip to content

Commit

Permalink
Fix max_tokens handling in vllm_vlms.py (#2637)
Browse files Browse the repository at this point in the history
* Update vllm_vlms.py

* pre-commit

---------

Co-authored-by: Baber <[email protected]>
  • Loading branch information
jkaniecki and baberabb authored Jan 21, 2025
1 parent b2c090c commit 370e2f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lm_eval/models/vllm_vlms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 370e2f9

Please sign in to comment.