将HF模型推送到Hub。

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

How push HF model to the hub

问题

I have a related issue can any one solve it?
Problem described well here

我有一个相关的问题,有人可以解决吗?
这里描述了问题得很好

I am expacting to pushing the model not only tokenizer and processor as:
link

我期望能够推送模型,而不仅仅是令牌化器和处理器,如下:
链接

英文:

I have a related issue can any one solve it?
Problem described well here

I am expacting to pushing the model not only tokenizer and processor as :
link

答案1

得分: 1

你可以按照这个指南操作 链接

pt_model = DistilBertForSequenceClassification.from_pretrained("路径/到/你选择的厉害名称", from_tf=True)
pt_model.save_pretrained("路径/到/你选择的厉害名称")
pt_model.push_to_hub("my-awesome-org/my-awesome-model")

你可以直接在你的模型上调用push_to_hub来上传它到Hub。
在push_to_hub中指定你的模型名称:

pt_model.push_to_hub("my-awesome-model")

push_to_hub函数还可用于将其他文件添加到模型存储库中。例如,将一个分词器添加到模型存储库:

tokenizer.push_to_hub("my-awesome-model")
英文:

you can follow this instruction Link

pt_model = DistilBertForSequenceClassification.from_pretrained("path/to/awesome-name-you-picked", from_tf=True)
pt_model.save_pretrained("path/to/awesome-name-you-picked")
pt_model.push_to_hub("my-awesome-org/my-awesome-model")

you can call push_to_hub directly on your model to upload it to the Hub.
Specify your model name in push_to_hub:

pt_model.push_to_hub("my-awesome-model")

The push_to_hub function can also be used to add other files to a model repository. For example, add a tokenizer to a model repository:

tokenizer.push_to_hub("my-awesome-model")

huangapple
  • 本文由 发表于 2023年4月13日 19:12:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76004759.html
匿名

发表评论

匿名网友

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

确定