[Bugfix] fix crash if max_tokens=None (#2570)

This commit is contained in:
Nikola Borisov
2024-01-23 22:38:55 -08:00
committed by GitHub
parent 1e4277d2d1
commit 3209b49033
3 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
"""Tests for the SamplingParams class.
"""
from vllm import SamplingParams
def test_max_tokens_none():
"""max_tokens=None should be allowed"""
SamplingParams(temperature=0.01, top_p=0.1, max_tokens=None)
if __name__ == "__main__":
import pytest
pytest.main([__file__])