Skip to content

Commit 700bb5d

Browse files
authored
Merge pull request #73 from trujillm/hf-login-check
Hf login check
2 parents 7df3028 + 2575da4 commit 700bb5d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

charts/all/vllm-inference-service/templates/inference-service.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ spec:
3535
python - <<'PY'
3636
from huggingface_hub import snapshot_download, login
3737
import os
38-
token = os.environ.get("HF_TOKEN")
38+
raw_token = os.environ.get("HF_TOKEN", "")
39+
token = raw_token.strip()
3940
model = os.environ.get("MODEL_ID")
40-
login(token=token)
41+
if not token or not token.startswith("hf_"):
42+
print("[HF] HF_TOKEN empty or invalid format; skipping login")
43+
os.environ.pop("HF_TOKEN", None)
44+
else:
45+
print("[HF] HF_TOKEN present; attempting login")
46+
login(token=token)
4147
snapshot_download(
4248
repo_id=model,
4349
local_dir="/cache/models"
@@ -51,6 +57,7 @@ spec:
5157
secretKeyRef:
5258
name: huggingface-secret
5359
key: hftoken
60+
optional: true
5461
- name: MODEL_ID
5562
value: {{ .Values.global.model.vllm | quote }}
5663
volumeMounts:

0 commit comments

Comments
 (0)