Skip to content
Discussion options

You must be logged in to vote

The best way is to pass the HF_TOKEN as an environment variable in your docker-compose.yml or container runner. The 00_download_model.py script checks os.getenv('HF_TOKEN') first.

Alternatively, if you want to avoid exposing the token in environment variables, you can mount the cache directory to a host path. For example, in your Docker configuration, mount ~/.cache/huggingface on the host to /root/.cache/huggingface inside the container. This preserves credentials across container restarts without needing to pass the token value directly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AhmadHassan-BTed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant