Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Skvortsov <[email protected]>
  • Loading branch information
southfreebird committed Feb 25, 2025
1 parent ad5eb16 commit fb8d0f3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tests/entrypoints/llm/test_guided_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,26 @@
from vllm.outputs import RequestOutput
from vllm.sampling_params import GuidedDecodingParams, SamplingParams

MODEL_NAME = "Qwen/Qwen2.5-1.5B-Instruct"
MODEL_NAME = "Qwen/Qwen2.5-7B-Instruct"
GUIDED_DECODING_BACKENDS = ["outlines", "lm-format-enforcer", "xgrammar"]


@pytest.fixture(scope="module", params=["regular", "speculative"])
@pytest.fixture(scope="module", params=["autoregressive", "speculative"])
def llm(request):

def get_llm_kwargs(mode: str):
if mode == "regular":
return {}
return {
# the model with fixed vocabulary size
"speculative_model": "tugstugi/Qwen2.5-Coder-0.5B-QwQ-draft",
"num_speculative_tokens": 3,
}
if mode == "autoregressive":
llm_kwargs = {}
elif mode == "speculative":
llm_kwargs = {
# the model with fixed vocabulary size
"speculative_model": "tugstugi/Qwen2.5-Coder-0.5B-QwQ-draft",
"num_speculative_tokens": 3,
}
else:
raise ValueError(f"Unsupported LLM mode: {mode}")

return llm_kwargs

test_llm_kwargs = get_llm_kwargs(request.param)
# pytest caches the fixture so we use weakref.proxy to
Expand Down

0 comments on commit fb8d0f3

Please sign in to comment.