upload model
Browse files- upload_model.py +12 -0
upload_model.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import HfApi
|
| 2 |
+
|
| 3 |
+
# Initialize the API client
|
| 4 |
+
api = HfApi()
|
| 5 |
+
|
| 6 |
+
# Upload the model file to the Hugging Face Hub
|
| 7 |
+
api.upload_file(
|
| 8 |
+
path_or_fileobj="models/05_going_modular_script_mode_tinyvgg_model.pth", # Replace with the path to your model file
|
| 9 |
+
path_in_repo="pytorch_model.bin", # The name under which the file will be stored in the repo
|
| 10 |
+
repo_id="ajitsi/tinyvgg", # Replace with your username and repo name
|
| 11 |
+
repo_type="model" # Specifies that it's a model repository
|
| 12 |
+
)
|