Error when doing `push_to_hub` two times in a row
See original GitHub issueWhen doing tokenizer.push_to_hub()
with the same tokenizer that was already uploaded (can happen in a notebook in particular), we have a git error:
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
~/miniconda2/envs/datasets/lib/python3.7/site-packages/huggingface_hub/repository.py in git_commit(self, commit_message)
424 encoding="utf-8",
--> 425 cwd=self.local_dir,
426 )
~/miniconda2/envs/datasets/lib/python3.7/subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
511 raise CalledProcessError(retcode, process.args,
--> 512 output=stdout, stderr=stderr)
513 return CompletedProcess(process.args, retcode, stdout, stderr)
CalledProcessError: Command '['git', 'commit', '-m', 'add tokenizer']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
<ipython-input-55-99316ec239b8> in <module>
----> 1 new_tokenizer.push_to_hub("thomwolf/codeparrot-small-vocabulary")
2
3 reloaded_tokenizer_small = AutoTokenizer.from_pretrained("thomwolf/codeparrot-small-vocabulary")
~/miniconda2/envs/datasets/lib/python3.7/site-packages/transformers/file_utils.py in push_to_hub(self, repo_path_or_name, repo_url, use_temp_dir, commit_message, organization, private, use_auth_token)
2029 self.save_pretrained(repo_path_or_name)
2030 # Commit and push!
-> 2031 url = self._push_to_hub(repo, commit_message=commit_message)
2032
2033 # Clean up! Clean up! Everybody everywhere!
~/miniconda2/envs/datasets/lib/python3.7/site-packages/transformers/file_utils.py in _push_to_hub(cls, repo, commit_message)
2109 commit_message = "add model"
2110
-> 2111 return repo.push_to_hub(commit_message=commit_message)
~/miniconda2/envs/datasets/lib/python3.7/site-packages/huggingface_hub/repository.py in push_to_hub(self, commit_message)
459 """
460 self.git_add()
--> 461 self.git_commit(commit_message)
462 return self.git_push()
463
~/miniconda2/envs/datasets/lib/python3.7/site-packages/huggingface_hub/repository.py in git_commit(self, commit_message)
429 raise EnvironmentError(exc.stderr)
430 else:
--> 431 raise EnvironmentError(exc.stdout)
432
433 def git_push(self) -> str:
OSError: Sur la branche main
Votre branche est à jour avec 'origin/main'.
rien à valider, la copie de travail est propre
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Push_to_hub usage errors? - Beginners
Trying to push my model back to the hub from python (not notebook) and failing so far: I am using a T5 model...
Read more >The Push to Hub API (PyTorch)
Easily share your fine-tuned models on the Hugging Face Hub using the push to hub API.This video is part of the Hugging Face...
Read more >The push to hub API
Easily share your fine-tuned models on the Hugging Face Hub using the push to hub API. This is the old version of the...
Read more >Power Query error 'The key didn't match any rows in ...
I'm trying to merge multiple excel files into one spreadsheet using Power Query, but I receive the following error when doing so:
Read more >huggingface-hub Changelog
Create tag twice doesn't work by Wauplin in 1149 ... Unified way to handle HTTP errors using `hf_raise_for_status` (more informative error message)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please open a new issue when you encounter a bug that is different. Here the problem is that you are not passing a valid name, it should just be
model.push_to_hub("my-model-name")
(happy to discuss more on another issue if you still have problems).This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.