Spaces:
Runtime error
Runtime error
Put back cloning instead
Browse files- 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 |
-
|
20 |
-
|
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 |
-
|
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)
|
113 |
-
|
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. """
|