[Python] tokenizer.push_to_hub(repo_name) is not working

Discussão em 'Python' iniciado por Stack, Junho 4, 2025.

  1. Stack

    Stack Membro Participativo

    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('Token')
    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..

    Continue reading...

Compartilhe esta Página