-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[ci] CI supports use cached models #7874
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9fd5cd8
ci support cache
HanHan009527 082498e
ci support cache
HanHan009527 d47fe25
ci support cache
HanHan009527 55b3741
ci support cache
HanHan009527 4cb4149
lint
HanHan009527 eaf3666
Update scripts/ci_cache_models.sh
HanHan009527 7d05f8f
lint
HanHan009527 421d235
Merge branch 'main' into h20_ci
HanHan009527 b3b54e1
Merge branch 'main' into h20_ci
HanHan009527 6e3ad66
Merge branch 'main' into h20_ci
HanHan009527 26569f2
Merge branch 'main' into h20_ci
HanHan009527 b113b5e
fix review comments
HanHan009527 9b8874c
fix
HanHan009527 ba55fc9
fix
HanHan009527 1dbb714
fix
HanHan009527 cc58cc2
Merge branch 'main' into h20_ci
HanHan009527 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
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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
| set -euxo pipefail | ||
|
|
||
| mapfile -t models < <(python3 -c "from sglang.test.test_utils import _get_default_models; print(_get_default_models())" | jq -r '.[]') | ||
|
|
||
| if [ ${#models[@]} -eq 0 ]; then | ||
| echo "Failed to get default models." | ||
| exit 1 | ||
| fi | ||
|
|
||
| cache_dir="${DEFAULT_MODEL_CACHE_DIR:-}" | ||
|
|
||
| if [ -z "$cache_dir" ]; then | ||
| echo "DEFAULT_MODEL_CACHE_DIR environment variable is not set." | ||
| exit 1 | ||
| fi | ||
|
|
||
| failed_models=() | ||
| for model in "${models[@]}"; do | ||
| local_model_dir="$cache_dir/$model" | ||
| echo "Caching model: $model to $local_model_dir" | ||
| mkdir -p "$local_model_dir" | ||
|
|
||
| if ! huggingface-cli download "$model" \ | ||
| --local-dir "$local_model_dir" \ | ||
| --local-dir-use-symlinks False 2>/dev/null; then | ||
| echo "WARNING: Failed to cache model: $model" | ||
| rm -rf "$local_model_dir" | ||
| failed_models+=("$model") | ||
| continue | ||
| fi | ||
| echo "Successfully cached model: $model" | ||
| done | ||
|
|
||
| if [ ${#failed_models[@]} -gt 0 ]; then | ||
| echo -e "\n[Summary] Failed to cache following models:" | ||
| printf ' - %s\n' "${failed_models[@]}" | ||
| else | ||
| echo -e "\n[Summary] All models cached successfully" | ||
| fi | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.