Spaces:
Running
Running
update data repo
Browse files- src/saving_utils.py +3 -3
src/saving_utils.py
CHANGED
|
@@ -43,13 +43,13 @@ def save_results(method_name, benchmark_types, results, repo_id="mgyigit/probe-d
|
|
| 43 |
|
| 44 |
|
| 45 |
def download_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 46 |
-
api = HfApi(token=os.getenv("
|
| 47 |
|
| 48 |
benchmark_types.append("leaderboard")
|
| 49 |
for benchmark in benchmark_types:
|
| 50 |
file_name = f"{benchmark}_results.csv"
|
| 51 |
local_path = f"/tmp/{file_name}"
|
| 52 |
-
|
| 53 |
try:
|
| 54 |
# Download the file from the specified repo
|
| 55 |
api.hf_hub_download(
|
|
@@ -57,7 +57,7 @@ def download_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="
|
|
| 57 |
repo_type=repo_type,
|
| 58 |
filename=file_name,
|
| 59 |
local_dir="/tmp",
|
| 60 |
-
token=os.getenv("
|
| 61 |
)
|
| 62 |
print(f"Downloaded {file_name} from {repo_id} to {local_path}")
|
| 63 |
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
def download_from_hub(benchmark_types, repo_id="mgyigit/probe-data", repo_type="space"):
|
| 46 |
+
api = HfApi(token=os.getenv("api_key")) #load api_key secret
|
| 47 |
|
| 48 |
benchmark_types.append("leaderboard")
|
| 49 |
for benchmark in benchmark_types:
|
| 50 |
file_name = f"{benchmark}_results.csv"
|
| 51 |
local_path = f"/tmp/{file_name}"
|
| 52 |
+
|
| 53 |
try:
|
| 54 |
# Download the file from the specified repo
|
| 55 |
api.hf_hub_download(
|
|
|
|
| 57 |
repo_type=repo_type,
|
| 58 |
filename=file_name,
|
| 59 |
local_dir="/tmp",
|
| 60 |
+
token=os.getenv("api_key"),
|
| 61 |
)
|
| 62 |
print(f"Downloaded {file_name} from {repo_id} to {local_path}")
|
| 63 |
|