[BugFix] Fix test_phi3v.py (#5725)
This commit is contained in:
@@ -77,7 +77,7 @@ if is_cpu():
|
||||
# numeric difference for longer context and test can't pass
|
||||
@pytest.mark.parametrize("model_and_config", model_and_vl_config)
|
||||
@pytest.mark.parametrize("dtype", [target_dtype])
|
||||
@pytest.mark.parametrize("max_tokens", [8])
|
||||
@pytest.mark.parametrize("max_tokens", [128])
|
||||
def test_models(hf_runner, vllm_runner, hf_images, vllm_images,
|
||||
model_and_config, dtype: str, max_tokens: int) -> None:
|
||||
"""Inference result should be the same between hf and vllm.
|
||||
@@ -95,9 +95,11 @@ def test_models(hf_runner, vllm_runner, hf_images, vllm_images,
|
||||
hf_model_kwargs = {"_attn_implementation": "eager"}
|
||||
with hf_runner(model_id, dtype=dtype,
|
||||
model_kwargs=hf_model_kwargs) as hf_model:
|
||||
hf_outputs = hf_model.generate_greedy(HF_IMAGE_PROMPTS,
|
||||
max_tokens,
|
||||
images=hf_images)
|
||||
hf_outputs = hf_model.generate_greedy(
|
||||
HF_IMAGE_PROMPTS,
|
||||
max_tokens,
|
||||
images=hf_images,
|
||||
eos_token_id=hf_model.processor.tokenizer.eos_token_id)
|
||||
|
||||
vllm_image_prompts = [
|
||||
p.replace("<|image_1|>",
|
||||
|
||||
Reference in New Issue
Block a user