@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 40a8756224
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 22:45 UTC

[Chore]: Remove HF format Phi4-MM examples (#31405)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Dec 27, 2025 at 21:42 UTC 40a8756224861cd4a1b1c7969ae1b2a86dc33f3d
3 files changed -103
examples/offline_inference/audio_language.py
-32
@@ -213,37 +213,6 @@ def run_phi4mm(question: str, audio_count: int) -> ModelRequestData:
213 )
214
215
216 -def run_phi4_multimodal(question: str, audio_count: int) -> ModelRequestData:
217 - """
218 - Phi-4-multimodal-instruct supports both image and audio inputs. Here, we
219 - show how to process audio inputs.
220 - """
221 - model_path = snapshot_download(
222 - "microsoft/Phi-4-multimodal-instruct", revision="refs/pr/70"
223 - )
224 - # Since the vision-lora and speech-lora co-exist with the base model,
225 - # we have to manually specify the path of the lora weights.
226 - speech_lora_path = os.path.join(model_path, "speech-lora")
227 - placeholders = "<|audio|>" * audio_count
228 -
229 - prompts = f"<|user|>{placeholders}{question}<|end|><|assistant|>"
230 -
231 - engine_args = EngineArgs(
232 - model=model_path,
233 - max_model_len=12800,
234 - max_num_seqs=2,
235 - enable_lora=True,
236 - max_lora_rank=320,
237 - limit_mm_per_prompt={"audio": audio_count},
238 - )
239 -
240 - return ModelRequestData(
241 - engine_args=engine_args,
242 - prompt=prompts,
243 - lora_requests=[LoRARequest("speech", 1, speech_lora_path)],
244 - )
245 -
246 -
216 # Qwen2-Audio
217 def run_qwen2_audio(question: str, audio_count: int) -> ModelRequestData:
218 model_name = "Qwen/Qwen2-Audio-7B-Instruct"
@@ -416,7 +385,6 @@ model_example_map = {
385 "midashenglm": run_midashenglm,
386 "minicpmo": run_minicpmo,
387 "phi4_mm": run_phi4mm,
419 - "phi4_multimodal": run_phi4_multimodal,
388 "qwen2_audio": run_qwen2_audio,
389 "qwen2_5_omni": run_qwen2_5_omni,
390 "ultravox": run_ultravox,
examples/offline_inference/vision_language.py
-36
@@ -1424,41 +1424,6 @@ def run_phi4mm(questions: list[str], modality: str) -> ModelRequestData:
1424 )
1425
1426
1427 -# HF format Phi-4-multimodal-instruct
1428 -def run_phi4_multimodal(questions: list[str], modality: str) -> ModelRequestData:
1429 - """
1430 - Phi-4-multimodal-instruct supports both image and audio inputs. Here, we
1431 - show how to process image inputs.
1432 - """
1433 - assert modality == "image"
1434 - model_path = snapshot_download(
1435 - "microsoft/Phi-4-multimodal-instruct", revision="refs/pr/70"
1436 - )
1437 - # Since the vision-lora and speech-lora co-exist with the base model,
1438 - # we have to manually specify the path of the lora weights.
1439 - vision_lora_path = os.path.join(model_path, "vision-lora")
1440 - prompts = [
1441 - f"<|user|><|image|>{question}<|end|><|assistant|>" for question in questions
1442 - ]
1443 - engine_args = EngineArgs(
1444 - model=model_path,
1445 - max_model_len=5120,
1446 - max_num_seqs=2,
1447 - max_num_batched_tokens=12800,
1448 - enable_lora=True,
1449 - max_lora_rank=320,
1450 - # Note - mm_processor_kwargs can also be passed to generate/chat calls
1451 - mm_processor_kwargs={"dynamic_hd": 16},
1452 - limit_mm_per_prompt={"image": 1},
1453 - )
1454 -
1455 - return ModelRequestData(
1456 - engine_args=engine_args,
1457 - prompts=prompts,
1458 - lora_requests=[LoRARequest("vision", 1, vision_lora_path)],
1459 - )
1460 -
1461 -
1427 # Pixtral HF-format
1428 def run_pixtral_hf(questions: list[str], modality: str) -> ModelRequestData:
1429 assert modality == "image"
@@ -1904,7 +1869,6 @@ model_example_map = {
1869 "paligemma2": run_paligemma2,
1870 "phi3_v": run_phi3v,
1871 "phi4_mm": run_phi4mm,
1907 - "phi4_multimodal": run_phi4_multimodal,
1872 "pixtral_hf": run_pixtral_hf,
1873 "qwen_vl": run_qwen_vl,
1874 "qwen2_vl": run_qwen2_vl,
examples/offline_inference/vision_language_multi_image.py
-35
@@ -932,40 +932,6 @@ def load_phi4mm(question: str, image_urls: list[str]) -> ModelRequestData:
932 )
933
934
935 -def load_phi4_multimodal(question: str, image_urls: list[str]) -> ModelRequestData:
936 - """
937 - Phi-4-multimodal-instruct supports both image and audio inputs. Here, we
938 - show how to process multi images inputs.
939 - """
940 -
941 - model_path = snapshot_download(
942 - "microsoft/Phi-4-multimodal-instruct", revision="refs/pr/70"
943 - )
944 - # Since the vision-lora and speech-lora co-exist with the base model,
945 - # we have to manually specify the path of the lora weights.
946 - vision_lora_path = os.path.join(model_path, "vision-lora")
947 - engine_args = EngineArgs(
948 - model=model_path,
949 - max_model_len=4096,
950 - max_num_seqs=2,
951 - limit_mm_per_prompt={"image": len(image_urls)},
952 - enable_lora=True,
953 - max_lora_rank=320,
954 - # Note - mm_processor_kwargs can also be passed to generate/chat calls
955 - mm_processor_kwargs={"dynamic_hd": 4},
956 - )
957 -
958 - placeholders = "<|image|>" * len(image_urls)
959 - prompt = f"<|user|>{placeholders}{question}<|end|><|assistant|>"
960 -
961 - return ModelRequestData(
962 - engine_args=engine_args,
963 - prompt=prompt,
964 - image_data=[fetch_image(url) for url in image_urls],
965 - lora_requests=[LoRARequest("vision", 1, vision_lora_path)],
966 - )
967 -
968 -
935 def load_qwen_vl_chat(question: str, image_urls: list[str]) -> ModelRequestData:
936 model_name = "Qwen/Qwen-VL-Chat"
937 engine_args = EngineArgs(
@@ -1363,7 +1329,6 @@ model_example_map = {
1329 "paddleocr_vl": load_paddleocr_vl,
1330 "phi3_v": load_phi3v,
1331 "phi4_mm": load_phi4mm,
1366 - "phi4_multimodal": load_phi4_multimodal,
1332 "pixtral_hf": load_pixtral_hf,
1333 "qwen_vl_chat": load_qwen_vl_chat,
1334 "qwen2_vl": load_qwen2_vl,