How to handle Hugging Face token authentication when deploying Fractal in headless Docker environments? #1
|
When deploying the orchestrator or inference maker in a headless Docker environment (e.g. EC2/VPS without interactive CLI), how is it recommended to authenticate Hugging Face? Should we pass the |
Replies: 1 comment
|
The best way is to pass the 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 |
The best way is to pass the
HF_TOKENas an environment variable in yourdocker-compose.ymlor container runner. The00_download_model.pyscript checksos.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/huggingfaceon the host to/root/.cache/huggingfaceinside the container. This preserves credentials across container restarts without needing to pass the token value directly.