Open kyujin-cho opened 4 days ago
Thanks @kyujin-cho for investigating and reporting this bug! This should definitely be fixed. I opened https://github.com/huggingface/huggingface_hub/pull/2367 to add a try/except around tmp_file.unlink()
, hence preventing any IO issue when trying to chmod the file.
Thanks for the response. Glad to hear that!
Describe the bug
While trying to download the model by the help of
download
command, I have found that settingmodel_dir
path to a folder residing right under the root (e.g./models
) makes the process to fail.Seems like the specific line inside the implementation of
_chmod_and_move()
function, which assumes that the grandparent folder of the original destination (dst.parent.parent
) is always writable, causes the error: https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/file_download.py#L1936Reproduction
Create a writable folder under root (e.g.
/models
) and try to store the artifact under the destination likehuggingface_hub download --model-dir /models https://huggingface.co/openai/whisper-tiny
Logs
System info