Add vLLM-Omni library info to Hugging Face Hub requests (#5381)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-09-08 10:08:38 -06:00
1 parent 7a80b79698
commit fdaf4e31bd
57 files changed
+259 -220

No files matched your search

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""E2E accuracy guard against a pinned Lightricks LTX pipeline revision.
@@ -22,11 +22,11 @@ from typing import Literal
import numpy as np
import pytest
import torch
from huggingface_hub import hf_hub_download, snapshot_download
from torchmetrics.image import PeakSignalNoiseRatio, StructuralSimilarityIndexMeasure
from tests.e2e.accuracy.helpers import reset_artifact_dir
from tests.helpers.mark import hardware_test
from vllm_omni.transformers_utils.repo_utils import hf_api
OFFICIAL_REPOSITORY = "https://github.com/Lightricks/LTX-2.git"
OFFICIAL_REVISION = "9377758131b1ffde4b7f766804590a6617bf2ab9"
@@ -326,7 +326,7 @@ def _resolve_model(case: LTXAccuracyCase) -> Path:
if revision is None and model_id == case.model_id:
revision = case.model_revision
return Path(
snapshot_download(
hf_api().snapshot_download(
repo_id=model_id,
revision=revision,
allow_patterns=[
@@ -359,7 +359,7 @@ def _resolve_gemma_root(case: LTXAccuracyCase, model: Path) -> Path:
if configured_model and Path(configured_model).is_dir():
return Path(configured_model)
return Path(
snapshot_download(
hf_api().snapshot_download(
repo_id=case.gemma_model_id,
revision=case.gemma_model_revision,
allow_patterns=[
@@ -383,7 +383,7 @@ def _resolve_artifact(artifact: LTXArtifact, model: Path | None = None) -> Path:
if model_path.is_file():
return model_path
return Path(
hf_hub_download(
hf_api().hf_hub_download(
repo_id=artifact.repo_id,
repo_type=None if artifact.repo_type == "model" else artifact.repo_type,
filename=artifact.filename,
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""E2E test that follows the EXACT same flow as
``verl-omni/tests/workers/rollout/rollout_vllm/test_vllm_omni_generate.py``
@@ -35,7 +35,6 @@ from uuid import uuid4
import pytest
import ray
import torch
from huggingface_hub import snapshot_download
from omegaconf import OmegaConf
from transformers import AutoTokenizer
@@ -46,6 +45,7 @@ from tests.e2e.features.helpers.verl_omni_server import (
vLLMOmniHttpServerLocal,
)
from tests.helpers.mark import hardware_test
from vllm_omni.transformers_utils.repo_utils import hf_api
MODEL = "tiny-random/Qwen-Image"
TOKENIZER_MODEL = "Qwen/Qwen2-1.5B-Instruct"
@@ -55,7 +55,7 @@ _MIN_PROMPT_TOKENS = 35
def _resolve_model_path(repo_id: str) -> str:
if os.path.isdir(repo_id):
return repo_id
return snapshot_download(repo_id=repo_id)
return hf_api().snapshot_download(repo_id=repo_id)
@lru_cache(maxsize=1)
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""
Offline E2E smoke test for CosyVoice3 zero-shot reference inference.
@@ -20,7 +20,6 @@ from pathlib import Path
import numpy as np
import pytest
import soundfile as sf
from huggingface_hub import snapshot_download
from vllm.sampling_params import SamplingParams
from tests.helpers.mark import hardware_test
@@ -29,6 +28,7 @@ from tests.helpers.runtime import OmniRunner
from tests.helpers.stage_config import get_deploy_config_path
from vllm_omni.model_executor.models.cosyvoice3.tokenizer import get_qwen_tokenizer
from vllm_omni.transformers_utils.configs.cosyvoice3 import CosyVoice3Config
from vllm_omni.transformers_utils.repo_utils import hf_api
MODEL = "FunAudioLLM/Fun-CosyVoice3-0.5B-2512"
MODEL_DIR_ENV = "VLLM_OMNI_COSYVOICE3_MODEL_DIR"
@@ -58,7 +58,7 @@ def _resolve_model_dir() -> Path:
override = os.environ.get(MODEL_DIR_ENV)
if override:
return Path(override).expanduser().resolve()
return Path(snapshot_download(MODEL, allow_patterns=["*"]))
return Path(hf_api().snapshot_download(MODEL, allow_patterns=["*"]))
def _reference_zero_shot_stage0_sampling(*, text: str) -> SamplingParams:
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""
End-to-end test for MammothModa2 text-to-image generation.
@@ -19,12 +22,12 @@ from pathlib import Path
import pytest
import torch
from huggingface_hub import snapshot_download
from vllm.sampling_params import SamplingParams
from tests.helpers.mark import hardware_test
from tests.helpers.runtime import OmniRunner
from tests.helpers.stage_config import get_deploy_config_path
from vllm_omni.transformers_utils.repo_utils import hf_api
# ---------------------------------------------------------------------------
# Constants
@@ -64,7 +67,7 @@ _PIXEL_SAMPLE_COORDS = [
# Helpers
# ---------------------------------------------------------------------------
def _load_t2i_gen_config(repo_id: str) -> dict:
weights_dir = Path(snapshot_download(repo_id))
weights_dir = Path(hf_api().snapshot_download(repo_id))
cfg_path = weights_dir / "t2i_generation_config.json"
if not cfg_path.exists():
pytest.skip(f"t2i_generation_config.json not found at {cfg_path}")
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""E2E offline inference tests for MOSS-TTS-Realtime (MossTTSRealtime, 1.7B).
Uses the standard omni_runner + pytestmark pattern (one module-scoped engine
@@ -160,12 +160,13 @@ def _build_request(ref_audio_path: str, text: str) -> dict:
Frees the codec model before returning to avoid competing with the
running vllm engine for GPU/CPU memory.
"""
from huggingface_hub import snapshot_download
from transformers import AutoModel, AutoTokenizer
from vllm_omni.transformers_utils.repo_utils import hf_api
# Step 1: locate the realtime processor module in the snapshot.
try:
snap_dir = Path(snapshot_download(repo_id=MODEL))
snap_dir = Path(hf_api().snapshot_download(repo_id=MODEL))
except Exception as exc:
msg = f"Cannot locate snapshot for {MODEL}: {exc}"
if os.environ.get("MOSS_TTS_SKIP_ON_NET_FAIL"):
@@ -12,7 +12,6 @@ from pathlib import Path
from types import SimpleNamespace
import pytest
from huggingface_hub import snapshot_download
from tests.helpers.runtime import OmniServerParams, get_model_prefix
from tests.helpers.stage_config import (
@@ -20,6 +19,7 @@ from tests.helpers.stage_config import (
get_deploy_duplex_max_sessions,
modify_stage_config,
)
from vllm_omni.transformers_utils.repo_utils import hf_api
MODEL = "openbmb/MiniCPM-o-4_5"
DEPLOY_CONFIG_REL = "minicpmo_4_5.yaml"
@@ -111,7 +111,7 @@ def resolve_ref_audio() -> Path:
model_prefix = get_model_prefix()
model_root = Path(model_prefix) / MODEL if model_prefix else Path(MODEL)
if not model_root.is_dir():
model_root = Path(snapshot_download(MODEL, local_files_only=True))
model_root = Path(hf_api().snapshot_download(MODEL, local_files_only=True))
ref_audio = model_root / REF_AUDIO_RELATIVE_PATH
if not ref_audio.is_file():
raise FileNotFoundError(f"MiniCPM-o checkpoint ref audio is missing: {ref_audio}")