Spaces:
Sleeping
Sleeping
Download scripts/deploy_model.py from jaothan/GenAI_project: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/spaces/jaothan/GenAI_project/resolve/main/scripts/deploy_model.py
- Command line
-
hf download hf://spaces/jaothan/GenAI_project/scripts/deploy_model.py
-
curl -L -o deploy_model.py https://huggingface.co/spaces/jaothan/GenAI_project/resolve/main/scripts/deploy_model.py
484 Bytes
| from huggingface_hub import HfApi | |
| import os | |
| def deploy_model_to_huggingface(model_path, model_name): | |
| api = HfApi() | |
| api.upload_folder( | |
| folder_path=model_path, | |
| repo_id=model_name, | |
| commit_message="Deploying fine-tuned model", | |
| use_auth_token=os.getenv("HF_AUTH_TOKEN") | |
| ) | |
| if __name__ == "__main__": | |
| model_path = "./results_student" | |
| model_name = "your_model_name" | |
| deploy_model_to_huggingface(model_path, model_name) | |