tokenizer.push_to_hub(repo_name) is not working

Question:

I’m trying to puch my tokonizer to my huggingface repo…
it consist of the model vocab.Json (I’m making a speech recognition model)
My code:

vocab_dict["|"] = vocab_dict[" "]
del vocab_dict[" "]
vocab_dict["[UNK]"] = len(vocab_dict)
vocab_dict["[PAD]"] = len(vocab_dict)
len(vocab_dict)
import json
with open('vocab.json', 'w') as vocab_file:
    json.dump(vocab_dict, vocab_file)
from transformers import Wav2Vec2CTCTokenizer

tokenizer = Wav2Vec2CTCTokenizer.from_pretrained("./", unk_token="[UNK]", pad_token="[PAD]", word_delimiter_token="|")
from huggingface_hub import login

login('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')
repo_name = "Foxasdf/ArabicTextToSpeech"
add_to_git_credential=True
tokenizer.push_to_hub(repo_name)

the tokenizer.push_to_hub(repo_name) is giving me this error:
TypeError: create_repo() got an unexpected keyword argument ‘organization’

I have logged in my huggingface account using
from huggingface_hub import notebook_login
notebook_login()
but the error is still the same..
here’s a link of the my collab notebook you can see the full code there and the error: https://colab.research.google.com/drive/11tkQ85SfaT6U_1PXDNwk0Q6qogw2r2sw?hl=ar&hl=en&authuser=0#scrollTo=WkbZ_Wcidq8Z

Asked By: FOXASDF

||

Answers:

I have the same problem. It is somehow associated with version of transformers – I have 4.6. When I change environment to the one with 4.11.3 transformers version the problem is that code tries to clone repository which I am going to yet create and there is an error " Remote repository not found … "

Checked more and it looks like issue with version with huggingface_hub library – when it is downgraded to 0.10.1 it should work.

Answered By: Baltazar Gąbka

To resolve this issue, change the transformers library to version 4.24.0 with the command below:

pip install transformers==4.24.0
Answered By: Alvin Kimata

These library versions worked for me:

!pip install transformers==4.24.0
!pip install huggingface_hub==0.11

Also make sure you are accessing after notebook_login() cell execution.

Answered By: Soumendra