When starting my Hugging Face Space with Docker (during setup will do chmod -R 777 /app/hf_home
, then export HF_HOME=/app/hf_home
on launch) I get this error:
The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
0it [00:00, ?it/s]
0it [00:00, ?it/s]
There was a problem when trying to write in your cache folder (/app/hf_home/hub). You should set the environment variable TRANSFORMERS_CACHE to a writable directory.
Traceback (most recent call last):
File "/app/index.py", line 22, in <module>
snapshot_download(repo_id=model, revision="main", token=HF_AUTH_TOKEN)
Downloading AI model (mistralai/Mistral-7B-Instruct-v0.2)...
File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/huggingface_hub/_snapshot_download.py", line 261, in snapshot_download
with open(ref_path, "w") as f:
^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/app/hf_home/hub/models--mistralai--Mistral-7B-Instruct-v0.2/refs/main'