-
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
Open
zzhuoxin1508
wants to merge
14
commits into
vllm-project:main
Choose a base branch
from
zzhuoxin1508:fix/load-before-init
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+21
−4
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
89ffdad
Create README.md
zzhuoxin1508 0274127
Update README.md
zzhuoxin1508 942b9ba
Fix formatting in README for output option
zzhuoxin1508 429b9a3
Merge branch 'vllm-project:main' into main
zzhuoxin1508 cee7dd9
Merge branch 'vllm-project:main' into main
zzhuoxin1508 813dd18
Update omni.py
zzhuoxin1508 da08cf9
Update weight_utils.py
zzhuoxin1508 9f98029
Update omni.py
zzhuoxin1508 e1edaa8
Update weight_utils.py
zzhuoxin1508 aad43b6
Merge branch 'main' into fix/load-before-init
zzhuoxin1508 fadbfe2
Update omni.py
zzhuoxin1508 f9b147e
Fix formatting of allow_patterns list in omni.py
zzhuoxin1508 4589643
Update vllm_omni/model_executor/model_loader/weight_utils.py
zzhuoxin1508 b4ac980
Update vllm_omni/model_executor/model_loader/weight_utils.py
zzhuoxin1508 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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,24 @@ 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: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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".