Spaces:
Running
Running
add renaming
Browse files- data_utils.py +25 -10
data_utils.py
CHANGED
|
@@ -49,16 +49,31 @@ def load_all_data():
|
|
| 49 |
model_summary = json.load(f)
|
| 50 |
model_names = [model["Model"] for model in model_summary]
|
| 51 |
for model_name in model_names:
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
def get_random_item(model_name="random", size_H="random", size_W="random"):
|
| 64 |
global summary_file, result_dir, results_by_model
|
|
|
|
| 49 |
model_summary = json.load(f)
|
| 50 |
model_names = [model["Model"] for model in model_summary]
|
| 51 |
for model_name in model_names:
|
| 52 |
+
try:
|
| 53 |
+
model_rename_map = {
|
| 54 |
+
"Llama-3.1-405B-Inst-fp8@together": "Llama-3.1-405B-Instruct-Turbo",
|
| 55 |
+
"Llama-3.1-405B-Inst@hyperbolic": "Meta-Llama-3.1-405B-Instruct@hyperbolic",
|
| 56 |
+
"deepseek-v2-chat-0628": "deepseek-v2-chat",
|
| 57 |
+
"deepseek-v2-coder-0724": "DeepSeek-Coder-V2-0724",
|
| 58 |
+
"deepseek-v2-coder-0614": "deepseek-v2-coder",
|
| 59 |
+
"gemma-2-9b-it": "gemma-2-9b-it@nvidia",
|
| 60 |
+
"gemma-2-27b-it": "gemma-2-27b-it@nvidia"
|
| 61 |
+
}
|
| 62 |
+
if model_name in model_rename_map:
|
| 63 |
+
model_name = model_rename_map[model_name]
|
| 64 |
+
download_url = f"https://raw.githubusercontent.com/WildEval/ZeroEval/refs/heads/main/result_dirs/zebra-grid/{model_name}.json"
|
| 65 |
+
output_file = os.path.join(result_dir, f"{model_name}.json")
|
| 66 |
+
# mkdir -p result_dir if not exists
|
| 67 |
+
os.makedirs(result_dir, exist_ok=True)
|
| 68 |
+
if not os.path.exists(output_file):
|
| 69 |
+
os.system(f"wget {download_url} -O {output_file}")
|
| 70 |
+
print(f"Downloaded {model_name}.json")
|
| 71 |
+
with open(output_file, "r") as f:
|
| 72 |
+
print(f"Loading {output_file}")
|
| 73 |
+
results_by_model[model_name] = json.load(f)
|
| 74 |
+
except Exception as e:
|
| 75 |
+
print(f"Error loading {model_name}: {e}")
|
| 76 |
+
continue
|
| 77 |
|
| 78 |
def get_random_item(model_name="random", size_H="random", size_W="random"):
|
| 79 |
global summary_file, result_dir, results_by_model
|