kgauvin603 commited on
Commit
d8a0cf5
·
verified ·
1 Parent(s): 61cb383

Update train.py

Browse files
Files changed (1) hide show
  1. train.py +4 -3
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
- # Directly push the model file to the Hugging Face Hub from the dataset directory
102
- repo.push_to_hub(commit_message="Upload trained model", repo_id=repo_name)
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")