TheXeos commited on
Commit
83afd2f
1 Parent(s): 9f4feb7

Put back cloning instead

Browse files
Files changed (1) hide show
  1. background_task.py +6 -7
background_task.py CHANGED
@@ -16,9 +16,9 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
16
  repo = Repository(
17
  local_dir=ELO_DIR, clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
18
  )
19
- # repo_temp = Repository(
20
- # local_dir=ELO_DIR, clone_from=DATASET_TEMP_REPO_URL, use_auth_token=HF_TOKEN
21
- # )
22
 
23
  api = HfApi()
24
  os.chmod('./SoccerTows.x86_64', 0o755)
@@ -106,11 +106,10 @@ class Matchmaking:
106
  data_dict = {"model1": [], "model2": [], "timestamp": [], "result": []}
107
  df = pd.DataFrame(data_dict)
108
  print(df.head())
109
- # repo_temp.git_pull()
110
-
111
  df.to_csv(os.path.join(TEMP_DIR, TEMP_FILENAME), index=False)
112
- api.upload_file(os.path.join(TEMP_DIR, TEMP_FILENAME), "huggingface-projects/temp-match-results", repo_type="dataset")
113
- # repo_temp.push_to_hub(commit_message="Reset results.csv")
114
 
115
  def find_model(self, author, name):
116
  """ Find a model in the models list. """
 
16
  repo = Repository(
17
  local_dir=ELO_DIR, clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
18
  )
19
+ repo_temp = Repository(
20
+ local_dir=ELO_DIR, clone_from=DATASET_TEMP_REPO_URL, use_auth_token=HF_TOKEN
21
+ )
22
 
23
  api = HfApi()
24
  os.chmod('./SoccerTows.x86_64', 0o755)
 
106
  data_dict = {"model1": [], "model2": [], "timestamp": [], "result": []}
107
  df = pd.DataFrame(data_dict)
108
  print(df.head())
109
+ repo_temp.git_pull()
 
110
  df.to_csv(os.path.join(TEMP_DIR, TEMP_FILENAME), index=False)
111
+ api.upload_file(os.path.join(TEMP_DIR, TEMP_FILENAME))
112
+ repo_temp.push_to_hub(commit_message="Reset results.csv")
113
 
114
  def find_model(self, author, name):
115
  """ Find a model in the models list. """