Skip to content

Attempt hf login if token provided #114

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if [[ ! -z "${HF_MODEL_ID}" ]]; then
filename=${HF_DEFAULT_PIPELINE_NAME:-handler.py}
revision=${HF_REVISION:-main}

if [[ ! -z "${HF_HUB_TOKEN}" ]]; then
echo "Attempting HuggingFace CLI login"
huggingface-cli login --token $HF_HUB_TOKEN
else
echo "HF_HUB_TOKEN not provided"
fi

echo "Downloading $filename for model ${HF_MODEL_ID}"
huggingface-cli download ${HF_MODEL_ID} "$filename" --revision "$revision" --local-dir /tmp

Expand Down