Spaces:
Sleeping
Sleeping
Update train.py
Browse files
train.py
CHANGED
@@ -98,7 +98,8 @@ repo_url = api.create_repo(repo_id=repo_name, token=api_token, exist_ok=True)
|
|
98 |
# Initialize the repository
|
99 |
repo = Repository(local_dir="hf_model_repo", clone_from=repo_url, use_auth_token=api_token)
|
100 |
|
101 |
-
#
|
102 |
-
|
103 |
-
|
104 |
|
|
|
|
|
|
98 |
# Initialize the repository
|
99 |
repo = Repository(local_dir="hf_model_repo", clone_from=repo_url, use_auth_token=api_token)
|
100 |
|
101 |
+
# Move the model file to the repository directory
|
102 |
+
os.rename(saved_model_path, os.path.join("hf_model_repo", "model.joblib"))
|
|
|
103 |
|
104 |
+
# Push the model to the Hugging Face Hub
|
105 |
+
repo.push_to_hub(commit_message="Upload trained model")
|