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:
57 files changed
+259
-220
No files matched your search
@@ -10,7 +10,6 @@ import numpy as np
|
||||
import onnxruntime
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from huggingface_hub import snapshot_download
|
||||
from scipy.signal import resample_poly
|
||||
from transformers import Qwen2Config
|
||||
from transformers.feature_extraction_utils import BatchFeature
|
||||
@@ -52,6 +51,7 @@ from vllm_omni.model_executor.models.cosyvoice3.utils import (
|
||||
from vllm_omni.model_executor.models.output_templates import OmniOutput
|
||||
from vllm_omni.platforms import current_omni_platform
|
||||
from vllm_omni.transformers_utils.configs.cosyvoice3 import CosyVoice3Config
|
||||
from vllm_omni.transformers_utils.repo_utils import hf_api
|
||||
from vllm_omni.utils.speaker_cache import get_speaker_cache
|
||||
|
||||
logger = init_logger(__name__)
|
||||
@@ -137,7 +137,7 @@ class CosyVoice3MultiModalProcessor(BaseMultiModalProcessor[CosyVoice3MultiModal
|
||||
"""Build the per-model runtime components once (cached process-wide)."""
|
||||
# If model_dir is an HF repo ID (not a local path), resolve to cache.
|
||||
if not os.path.isdir(model_dir):
|
||||
model_dir = snapshot_download(model_dir)
|
||||
model_dir = hf_api().snapshot_download(model_dir)
|
||||
|
||||
tokenizer = get_qwen_tokenizer(
|
||||
token_path=os.path.join(model_dir, config.qwen_pretrain_path),
|
||||
@@ -463,7 +463,7 @@ class CosyVoice3Model(
|
||||
self.model_stage = vllm_config.model_config.model_stage
|
||||
model_dir = vllm_config.model_config.model
|
||||
if not os.path.isdir(model_dir):
|
||||
model_dir = snapshot_download(model_dir)
|
||||
model_dir = hf_api().snapshot_download(model_dir)
|
||||
self.model_dir = model_dir
|
||||
self.model = None
|
||||
if self.model_stage == "cosyvoice3_talker":
|
||||
@@ -918,7 +918,7 @@ class CosyVoice3Model(
|
||||
repo = getattr(self.config, "flow_estimator_onnx_repo", None)
|
||||
if repo:
|
||||
try:
|
||||
fetched_dir = snapshot_download(repo, allow_patterns=[fp16_name])
|
||||
fetched_dir = hf_api().snapshot_download(repo, allow_patterns=[fp16_name])
|
||||
fetched = os.path.join(fetched_dir, fp16_name)
|
||||
if os.path.exists(fetched):
|
||||
return fetched
|
||||
|
||||
Reference in new issue
Block a user