首页 > 解决方案 > 如何通过 git-lfs 将训练有素的 NLP 模型推送到 huggingface.co?

问题描述

我使用了“ !sudo apt-get install git-lfs”,并且我在 Windows 上,我在某个地方错了:我怎样才能通过这个错误消息?

文本:

[ ] model.push_to_hub (MY_MODEL_NAME, use_auth_token=HUGGINGFACE_API_KEY)
    tokenizer.push_to_hub(MY MODEL_NAME, use_auth_token-HUGGINGFACE_API_KEY)

07/09/2021 01:13:08 - INFO huggingface_hub.repository - git version 2.17.1
Sorry, no usage text found for "git-lfs"
--------------------------------------------------------------------
Called ProcessError                Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/huggingface hub/repository.py in git commit(self, commit_message)
    396                 encoding="utf-8",
--> 397                 cwd-self.local dir,
    398              )
------------------------------------ 5 frames ----------------------
Called ProcessError: Command '['git', 'commit', '-m', ' add model'] returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

OSError                             Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/huggingface_hub/repository.py in git commit(self, commit_message)

    401                 raise EnvironmentError(exc.stderr)
    402              else:
--> 403                 raise EnvironmentError (exc.stdout)
    404
    405     def git push(self) -> str:

OSError: On branch main
Your branch is ahead of origin/main' by 1 commit. 
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

截屏:

截屏

标签: pythongitnlphuggingface-transformersgpt-2

解决方案


推荐阅读