From 762de805ea2d9b55e49824dd4bc1b720c77df431 Mon Sep 17 00:00:00 2001 From: Roger Wang <136131678+ywang96@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:34:29 -0700 Subject: [PATCH] [Misc] Update Phi-3-Vision Example (#5981) Co-authored-by: Cyrus Leung --- examples/phi3v_example.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/phi3v_example.py b/examples/phi3v_example.py index 46b7be5cd94d8..f0b9b0e4fc959 100644 --- a/examples/phi3v_example.py +++ b/examples/phi3v_example.py @@ -10,8 +10,10 @@ def run_phi3v(): model_path = "microsoft/Phi-3-vision-128k-instruct" - # Note: The model has 128k context length by default which may cause OOM - # In this example, we override max_model_len to 2048. + # Note: The default setting of max_num_seqs (256) and + # max_model_len (128k) for this model may cause OOM. + # In this example, we override max_num_seqs to 5 while + # keeping the original context length of 128k. llm = LLM( model=model_path, trust_remote_code=True, @@ -19,7 +21,7 @@ def run_phi3v(): image_token_id=32044, image_input_shape="1,3,1008,1344", image_feature_size=1921, - max_model_len=2048, + max_num_seqs=5, ) image = Image.open("images/cherry_blossom.jpg")