huggingface model.push_to_hub(peft_model_id) NotADirectoryError: [Errno 20] Not a directory

64 Views Asked by At

I am trying to push a model to huggingface hub. My huggingface id is aben118 and the model name is test that I want to upload.

peft_model_id = "aben118/test"
model.push_to_hub(peft_model_id)

I face the following error and cannot figure out why.

NotADirectoryError: [Errno 20] Not a directory: '/u/hys4qm/.conda/envs/whisper/lib/python3.9/site-packages/huggingface_hub-0.20.3-py3.8.egg/huggingface_hub/templates/modelcard_template.md'

Note: I can successfully push using colab notebook. The script I am running is a .py file.

Note: In my /u/hys4qm/.conda/envs/whisper/lib/python3.9/site-packages/ folder I can see that I don't have any huggingface_hub-0.20.3-py3.8.egg folder, although I installed through pip3 install --upgrade huggingface_hub

1

There are 1 best solutions below

0
afsara_ben On

Doing conda install -c conda-forge huggingface_hub worked