Download model.py from mn00/ModelFrench: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/mn00/ModelFrench/resolve/main/model.py
- Command line
-
hf download hf://mn00/ModelFrench/model.py
-
curl -L -o model.py https://huggingface.co/mn00/ModelFrench/resolve/main/model.py
510 Bytes
| from huggingface_hub import HfApi, HfFolder, Repository | |
| model_dir = "flaubert_finetuned_full" | |
| username = "your-username" # Replace with your Hugging Face username | |
| model_name = "your-model-name" # Replace with your desired model name | |
| # Create the repository | |
| api = HfApi() | |
| repo_url = api.create_repo(name=model_name, token=HfFolder.get_token()) | |
| # Clone the repository | |
| repo = Repository(local_dir=model_dir, clone_from=repo_url) | |
| # Push the model to the Hub | |
| repo.push_to_hub(commit_message="Initial commit") | |