rohansampath commited on
Commit
554eaa1
·
verified ·
1 Parent(s): b03c5d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -34
app.py CHANGED
@@ -114,39 +114,7 @@ def run_mmlu_evaluation(all_subjects, num_subjects, num_shots, all_questions, nu
114
  gr.update(interactive=True),
115
  gr.update(interactive=True),
116
  gr.update(visible=False))
117
-
118
- def format_links_with_bullets(links_text):
119
- """Format links with bullet points for better readability"""
120
- lines = links_text.split('\n')
121
- return "• " + "\n• ".join(lines)
122
-
123
- # Function to format dataset preview for better display
124
- def enhanced_format_preview_for_display(preview_data):
125
- """
126
- Format the preview data with improved readability
127
- """
128
- # Create links with bullet points
129
- links_value = (
130
- f"Hugging Face: {preview_data['links']['huggingface']}\n"
131
- f"GitHub: {preview_data['links']['github']}\n"
132
- f"Paper: {preview_data['links']['paper']}"
133
- )
134
- links_formatted = format_links_with_bullets(links_value)
135
-
136
- # Create a table format with better column names
137
- rows = [
138
- {"Dataset Property": "Dataset Name", "Details": preview_data["dataset_name"]},
139
- {"Dataset Property": "Evaluation Type", "Details": preview_data["evaluation_type"]},
140
- {"Dataset Property": "Description", "Details": preview_data["description"]},
141
- {"Dataset Property": "Links", "Details": links_formatted},
142
- {"Dataset Property": "Organization", "Details": preview_data["organization"]},
143
- {"Dataset Property": "Number of Questions", "Details": preview_data["num_questions"]},
144
- {"Dataset Property": "Number of Input Tokens", "Details": preview_data["input_tokens"]},
145
- {"Dataset Property": "Estimated Evaluation Time", "Details": f"{preview_data['evaluation_time']['total_time_minutes']} minutes (for 2 models on A100)"}
146
- ]
147
-
148
- return pd.DataFrame(rows)
149
-
150
  # ---------------------------------------------------------------------------
151
  # 3. Gradio Interface
152
  # ---------------------------------------------------------------------------
@@ -314,7 +282,7 @@ with gr.Blocks(css="""
314
  # Get preview data if becoming visible
315
  if is_visible and dataset == "MMLU-Pro":
316
  preview_data = mmlupro_dataset_preview()
317
- formatted_preview = enhanced_format_preview_for_display(preview_data)
318
  return is_visible, gr.update(visible=True), formatted_preview, gr.update(value=button_text)
319
  elif is_visible:
320
  # For other datasets (not implemented yet)
 
114
  gr.update(interactive=True),
115
  gr.update(interactive=True),
116
  gr.update(visible=False))
117
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  # ---------------------------------------------------------------------------
119
  # 3. Gradio Interface
120
  # ---------------------------------------------------------------------------
 
282
  # Get preview data if becoming visible
283
  if is_visible and dataset == "MMLU-Pro":
284
  preview_data = mmlupro_dataset_preview()
285
+ formatted_preview = format_preview_for_display(preview_data)
286
  return is_visible, gr.update(visible=True), formatted_preview, gr.update(value=button_text)
287
  elif is_visible:
288
  # For other datasets (not implemented yet)