Tensing2009
Tensing2009

Reputation: 97

Huggingface Push_to_hub Permission denied for certain names

So I am retraining a whisper model and have it saved in a certain path (model_name_or_path). When I want to push it to the hub I sometimes get a [Errno 13] Permission denied I can push the adapter but not the model.

I would like to push to trained_model_repo ='4STest/DataSize06dentalAudioModel-medium' If I change the repo to ''4STest/lol'' there is no problem... Can anyone explain this?

My code looks as follows:

model = WhisperForConditionalGeneration.from_pretrained(model_name_or_path,load_in_8bit=False, device_map="auto")

model = PeftModel.from_pretrained(
model,
adapter_to_push,
)
#push adapter
model.push_to_hub(trained_adapter_repo,private=True)

#save model
model = model.merge_and_unload()
model.save_pretrained(trained_model_repo)
processor.save_pretrained(trained_model_repo)

#push model
model.push_to_hub(trained_model_repo,safe_serialization=True,private=True)
processor.push_to_hub(trained_model_repo,private=True)

Variables:

model_name_or_path="openai/whisper-medium"
adapter_to_push="./4STest/DA_model_partial_DS02medium/checkpoint-9"
trained_adapter_repo="4STest/DataSize02AudioAdapter-medium"
trained_model_repo="4STest/DataSize02AudioModel-medium"

Alternative trained_model_repo="4STest/lol" works just fine.

Any help is appreciated

Upvotes: 0

Views: 31

Answers (1)

Tensing2009
Tensing2009

Reputation: 97

So I think I figured it out.

There is not allowed to be directory in your working directory that has the same name as your organization.

So if your organization is YourOrg then you can not save your model to a directory with the same name model.save_pretrained("YourOrg/someModel")

Upvotes: 0

Related Questions