Spaces:
Running
Running
Commit
Β·
c4de40b
1
Parent(s):
b5c23a1
more updates
Browse files- app.py +14 -2
- data_loader.py +1 -1
- hf_operations.py +3 -3
app.py
CHANGED
|
@@ -190,9 +190,21 @@ with gr.Blocks(title="Every Eval Ever", theme=get_theme(), css=get_custom_css())
|
|
| 190 |
prev_btn = gr.Button("β", variant="secondary", size="sm", min_width=60)
|
| 191 |
page_info = gr.Markdown(value=init_page_info, elem_classes="page-info")
|
| 192 |
next_btn = gr.Button("β", variant="secondary", size="sm", min_width=60)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
page_dropdown = gr.Dropdown(
|
| 194 |
-
choices=
|
| 195 |
-
value=
|
| 196 |
visible=False,
|
| 197 |
)
|
| 198 |
|
|
|
|
| 190 |
prev_btn = gr.Button("β", variant="secondary", size="sm", min_width=60)
|
| 191 |
page_info = gr.Markdown(value=init_page_info, elem_classes="page-info")
|
| 192 |
next_btn = gr.Button("β", variant="secondary", size="sm", min_width=60)
|
| 193 |
+
# Extract choices and value from gr.update() dict, ensuring value is in choices
|
| 194 |
+
if isinstance(init_page_dropdown, dict):
|
| 195 |
+
page_choices = init_page_dropdown.get("choices", ["1"])
|
| 196 |
+
page_value = str(init_page_dropdown.get("value", "1")) if init_page_dropdown.get("value") is not None else "1"
|
| 197 |
+
# Ensure value exists in choices
|
| 198 |
+
if page_value not in page_choices:
|
| 199 |
+
page_value = page_choices[0] if page_choices else "1"
|
| 200 |
+
if not page_choices:
|
| 201 |
+
page_choices = ["1"]
|
| 202 |
+
else:
|
| 203 |
+
page_choices = ["1"]
|
| 204 |
+
page_value = "1"
|
| 205 |
page_dropdown = gr.Dropdown(
|
| 206 |
+
choices=page_choices,
|
| 207 |
+
value=page_value,
|
| 208 |
visible=False,
|
| 209 |
)
|
| 210 |
|
data_loader.py
CHANGED
|
@@ -17,7 +17,7 @@ def load_hf_dataset_on_startup():
|
|
| 17 |
"""Load all splits from HuggingFace dataset at startup."""
|
| 18 |
print("Loading dataset from HuggingFace...")
|
| 19 |
try:
|
| 20 |
-
dataset = load_dataset("
|
| 21 |
|
| 22 |
for split_name, split_data in dataset.items():
|
| 23 |
print(f"Loading split: {split_name} ({len(split_data)} rows)")
|
|
|
|
| 17 |
"""Load all splits from HuggingFace dataset at startup."""
|
| 18 |
print("Loading dataset from HuggingFace...")
|
| 19 |
try:
|
| 20 |
+
dataset = load_dataset("evaleval/every_eval_ever")
|
| 21 |
|
| 22 |
for split_name, split_data in dataset.items():
|
| 23 |
print(f"Loading split: {split_name} ({len(split_data)} rows)")
|
hf_operations.py
CHANGED
|
@@ -35,7 +35,7 @@ def validate_json_against_schema(json_data):
|
|
| 35 |
return False, f"β Validation error: {str(e)}"
|
| 36 |
|
| 37 |
|
| 38 |
-
def upload_to_hf_dataset(parquet_file, split_name, repo_id
|
| 39 |
"""
|
| 40 |
Upload a parquet file as a new split to the HF dataset.
|
| 41 |
|
|
@@ -63,7 +63,7 @@ def check_hf_authentication():
|
|
| 63 |
return False, "Not authenticated. Run: huggingface-cli login"
|
| 64 |
|
| 65 |
|
| 66 |
-
def check_duplicate_pr_exists(leaderboard_name, repo_id
|
| 67 |
"""
|
| 68 |
Check if a PR already exists for this leaderboard.
|
| 69 |
|
|
@@ -93,7 +93,7 @@ def check_duplicate_pr_exists(leaderboard_name, repo_id="deepmage121/eee_test"):
|
|
| 93 |
return False, None
|
| 94 |
|
| 95 |
|
| 96 |
-
def create_pr_for_new_leaderboard(leaderboard_name, parquet_file, repo_id
|
| 97 |
"""
|
| 98 |
Create a pull request to add a new leaderboard split.
|
| 99 |
|
|
|
|
| 35 |
return False, f"β Validation error: {str(e)}"
|
| 36 |
|
| 37 |
|
| 38 |
+
def upload_to_hf_dataset(parquet_file, split_name, repo_id):
|
| 39 |
"""
|
| 40 |
Upload a parquet file as a new split to the HF dataset.
|
| 41 |
|
|
|
|
| 63 |
return False, "Not authenticated. Run: huggingface-cli login"
|
| 64 |
|
| 65 |
|
| 66 |
+
def check_duplicate_pr_exists(leaderboard_name, repo_id):
|
| 67 |
"""
|
| 68 |
Check if a PR already exists for this leaderboard.
|
| 69 |
|
|
|
|
| 93 |
return False, None
|
| 94 |
|
| 95 |
|
| 96 |
+
def create_pr_for_new_leaderboard(leaderboard_name, parquet_file, repo_id):
|
| 97 |
"""
|
| 98 |
Create a pull request to add a new leaderboard split.
|
| 99 |
|