tokenizer.push_to_hub(repo_name) is not working.

huangapple go评论51阅读模式
英文:

tokenizer.push_to_hub(repo_name) is not working

问题

以下是您提供的文本的翻译部分:

我正在尝试将我的分词器推送到我的Hugging Face存储库...
它包括模型vocab.json(我正在创建语音识别模型)
我的代码:

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)
分词器.push_to_hub(repo_name)给我报错:
TypeError: create_repo() got an unexpected keyword argument 'organization'

我已经登录到我的Hugging Face帐户,使用
from huggingface_hub import notebook_login
notebook_login()
但错误仍然相同...
这是我的协作笔记本的链接,您可以在那里查看完整的代码和错误:https://colab.research.google.com/drive/11tkQ85SfaT6U_1PXDNwk0Q6qogw2r2sw?hl=ar&hl=en&authuser=0#scrollTo=WkbZ_Wcidq8Z

希望这有所帮助。如果您需要进一步的翻译或帮助,请随时告诉我。

英文:

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

答案1

得分: 0

我有相同的问题。它与transformers版本有关 - 我使用的是4.6版本。当我将环境更改为带有4.11.3 transformers版本的环境时,问题是代码尝试克隆我将要创建的存储库,然后出现错误 "找不到远程存储库..."。

经过更多的检查,看起来与huggingface_hub库的版本有关 - 当将其降级为0.10.1时,它应该可以工作。

英文:

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.

答案2

得分: 0

要解决这个问题,请使用以下命令将transformers库更改为版本4.24.0

pip install transformers==4.24.0
英文:

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

pip install transformers==4.24.0

答案3

得分: 0

以下是要翻译的内容:

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.

英文:

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.

huangapple
  • 本文由 发表于 2023年2月8日 19:29:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75385142.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定