Spaces:
Running
Running
Update src/saving_utils.py
Browse files- src/saving_utils.py +3 -3
src/saving_utils.py
CHANGED
|
@@ -6,7 +6,7 @@ from huggingface_hub import HfApi
|
|
| 6 |
script_dir = os.path.dirname(os.path.abspath(__file__)) # Directory of the running script
|
| 7 |
|
| 8 |
|
| 9 |
-
def save_results(method_name, benchmark_types, results, repo_id="
|
| 10 |
#First, download files to be updated from {repo_id}
|
| 11 |
download_files_from_hub(benchmark_types, repo_id, repo_type)
|
| 12 |
|
|
@@ -30,7 +30,7 @@ def save_results(method_name, benchmark_types, results, repo_id="mgiyigt/probe-d
|
|
| 30 |
def download_files_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 31 |
api = HfApi(token=os.getenv("api-key")) #load api-key secret
|
| 32 |
|
| 33 |
-
benchmark_types
|
| 34 |
for benchmark in benchmark_types:
|
| 35 |
file_name = f"{benchmark}_results.csv"
|
| 36 |
local_path = f"/tmp/{file_name}"
|
|
@@ -55,8 +55,8 @@ def download_files_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_
|
|
| 55 |
|
| 56 |
def upload_to_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 57 |
api = HfApi(token=os.getenv("api_key")) # Requires authentication via HF_TOKEN
|
| 58 |
-
benchmark_types += "leaderboard"
|
| 59 |
|
|
|
|
| 60 |
for benchmark in benchmark_types:
|
| 61 |
file_name = f"{benchmark}_results.csv"
|
| 62 |
local_path = f"/tmp/{file_name}"
|
|
|
|
| 6 |
script_dir = os.path.dirname(os.path.abspath(__file__)) # Directory of the running script
|
| 7 |
|
| 8 |
|
| 9 |
+
def save_results(method_name, benchmark_types, results, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 10 |
#First, download files to be updated from {repo_id}
|
| 11 |
download_files_from_hub(benchmark_types, repo_id, repo_type)
|
| 12 |
|
|
|
|
| 30 |
def download_files_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 31 |
api = HfApi(token=os.getenv("api-key")) #load api-key secret
|
| 32 |
|
| 33 |
+
benchmark_types.append("leaderboard")
|
| 34 |
for benchmark in benchmark_types:
|
| 35 |
file_name = f"{benchmark}_results.csv"
|
| 36 |
local_path = f"/tmp/{file_name}"
|
|
|
|
| 55 |
|
| 56 |
def upload_to_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 57 |
api = HfApi(token=os.getenv("api_key")) # Requires authentication via HF_TOKEN
|
|
|
|
| 58 |
|
| 59 |
+
benchmark_types.append("leaderboard")
|
| 60 |
for benchmark in benchmark_types:
|
| 61 |
file_name = f"{benchmark}_results.csv"
|
| 62 |
local_path = f"/tmp/{file_name}"
|