-
Notifications
You must be signed in to change notification settings - Fork 395
[Fix]Ensure HuggingFace downloads complete before initialization. #1213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
89ffdad
0274127
942b9ba
429b9a3
cee7dd9
813dd18
da08cf9
9f98029
e1edaa8
aad43b6
fadbfe2
f9b147e
4589643
b4ac980
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,9 @@ | |
| resolve_model_config_path, | ||
| ) | ||
| from vllm_omni.inputs.data import OmniDiffusionSamplingParams, OmniPromptType, OmniSamplingParams | ||
| from vllm_omni.model_executor.model_loader.weight_utils import ( | ||
| download_weights_from_hf_specific, | ||
| ) | ||
| from vllm_omni.outputs import OmniRequestOutput | ||
|
|
||
| logger = init_logger(__name__) | ||
|
|
@@ -68,14 +71,29 @@ def _dummy_snapshot_download(model_id): | |
|
|
||
|
|
||
| def omni_snapshot_download(model_id) -> str: | ||
| # If it's already a local path, just return it | ||
| if os.path.exists(model_id): | ||
| return model_id | ||
|
|
||
| # TODO: this is just a workaround for quickly use modelscope, we should support | ||
| # modelscope in weight loading feature instead of using `snapshot_download` | ||
| if os.environ.get("VLLM_USE_MODELSCOPE", False): | ||
| from modelscope.hub.snapshot_download import snapshot_download | ||
|
|
||
| return snapshot_download(model_id) | ||
| else: | ||
| return _dummy_snapshot_download(model_id) | ||
|
|
||
| # For other cases (Hugging Face), perform a real download to ensure all | ||
| # necessary files (including *.pt for audio/diffusion) are available locally | ||
|
||
| # before stage workers are spawned. This prevents initialization timeouts. | ||
| return download_weights_from_hf_specific( | ||
| model_name_or_path=model_id, | ||
| cache_dir=None, | ||
| allow_patterns=[ | ||
| "**/*.json", "**/*.bin", "**/*.safetensors", "**/*.pt", | ||
| "**/*.txt", "**/*.model", "**/*.yaml" | ||
|
||
| ], | ||
| require_all=True, | ||
| ) | ||
|
|
||
|
|
||
| class OmniBase: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 77 has trailing whitespace. Remove the trailing space after "return model_id".