Spaces:
Running
Running
Commit ·
197a18e
1
Parent(s): 504345b
fix: make curl downloads non-fatal with set -e
Browse files- docker-entrypoint.sh +4 -4
docker-entrypoint.sh
CHANGED
|
@@ -37,7 +37,8 @@ if [ ! -f "$MODELS_YAML" ] && [ -n "$HF_TOKEN" ]; then
|
|
| 37 |
curl -sfL $CURL_PROXY \
|
| 38 |
-H "Authorization: Bearer $HF_TOKEN" \
|
| 39 |
-o "$MODELS_YAML" \
|
| 40 |
-
"https://huggingface.co/${HF_REPO}/resolve/main/starry-dist/models.yaml?download=true"
|
|
|
|
| 41 |
fi
|
| 42 |
|
| 43 |
# Parse models.yaml and set env vars (only if not already set)
|
|
@@ -106,11 +107,10 @@ hf_download() {
|
|
| 106 |
|
| 107 |
echo " Downloading $subdir/$relpath ..."
|
| 108 |
mkdir -p "$(dirname "$dest")"
|
| 109 |
-
curl -sfL $CURL_PROXY \
|
| 110 |
-H "Authorization: Bearer $HF_TOKEN" \
|
| 111 |
-o "$dest" \
|
| 112 |
-
"https://huggingface.co/${HF_REPO}/resolve/main/${subdir}/${relpath}?download=true"
|
| 113 |
-
if [ $? -eq 0 ] && [ -f "$dest" ]; then
|
| 114 |
echo " $subdir/$relpath downloaded OK."
|
| 115 |
else
|
| 116 |
echo " WARNING: Failed to download $subdir/$relpath"
|
|
|
|
| 37 |
curl -sfL $CURL_PROXY \
|
| 38 |
-H "Authorization: Bearer $HF_TOKEN" \
|
| 39 |
-o "$MODELS_YAML" \
|
| 40 |
+
"https://huggingface.co/${HF_REPO}/resolve/main/starry-dist/models.yaml?download=true" \
|
| 41 |
+
|| echo "Warning: Failed to download models.yaml (token may lack access)"
|
| 42 |
fi
|
| 43 |
|
| 44 |
# Parse models.yaml and set env vars (only if not already set)
|
|
|
|
| 107 |
|
| 108 |
echo " Downloading $subdir/$relpath ..."
|
| 109 |
mkdir -p "$(dirname "$dest")"
|
| 110 |
+
if curl -sfL $CURL_PROXY \
|
| 111 |
-H "Authorization: Bearer $HF_TOKEN" \
|
| 112 |
-o "$dest" \
|
| 113 |
+
"https://huggingface.co/${HF_REPO}/resolve/main/${subdir}/${relpath}?download=true"; then
|
|
|
|
| 114 |
echo " $subdir/$relpath downloaded OK."
|
| 115 |
else
|
| 116 |
echo " WARNING: Failed to download $subdir/$relpath"
|