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

Reset match history without cloning

Browse files
Files changed (1) hide show
  1. background_task.py +7 -5
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,9 +106,11 @@ 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
  df.to_csv(os.path.join(TEMP_DIR, TEMP_FILENAME), index=False)
111
- repo_temp.push_to_hub(commit_message="Reset results.csv")
 
112
 
113
  def find_model(self, author, name):
114
  """ 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
+
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. """