From 7d46c8d37864993162bbeb61dc19b5ad6043646d Mon Sep 17 00:00:00 2001 From: Isotr0py <2037008807@qq.com> Date: Wed, 19 Jun 2024 17:58:32 +0800 Subject: [PATCH] [Bugfix] Fix sampling_params passed incorrectly in Phi3v example (#5684) --- examples/phi3v_example.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/phi3v_example.py b/examples/phi3v_example.py index d5e60ae1ee3a2..4f37c47ddca87 100644 --- a/examples/phi3v_example.py +++ b/examples/phi3v_example.py @@ -12,7 +12,6 @@ def run_phi3v(): llm = LLM( model=model_path, trust_remote_code=True, - max_model_len=4096, image_input_type="pixel_values", image_token_id=32044, image_input_shape="1,3,1008,1344", @@ -28,11 +27,12 @@ def run_phi3v(): sampling_params = SamplingParams(temperature=0, max_tokens=64) - outputs = llm.generate({ - "prompt": prompt, - "sampling_params": sampling_params, - "multi_modal_data": ImagePixelData(image), - }) + outputs = llm.generate( + { + "prompt": prompt, + "multi_modal_data": ImagePixelData(image), + }, + sampling_params=sampling_params) for o in outputs: generated_text = o.outputs[0].text print(generated_text)