saridormi commited on
Commit
a9273cf
1 Parent(s): 2d26479

Fix url rendering for the leaderboard

Browse files
app.py CHANGED
@@ -16,6 +16,7 @@ from src.content import (
16
  SUBMISSION_TITLE,
17
  )
18
  from src.get_results_for_task import get_results_for_task
 
19
  from src.submission_uploader import SubmissionUploader
20
  from src.tasks_content import (
21
  TASKS_DESCRIPTIONS,
@@ -49,7 +50,11 @@ with gr.Blocks() as demo:
49
  with gr.Row():
50
  gr.Markdown(TASKS_DESCRIPTIONS[TASKS_PRETTY_REVERSE[task_pretty]])
51
 
52
- leaderboard_table = gr.components.Dataframe(value=get_results_for_task(task_pretty), interactive=False)
 
 
 
 
53
 
54
  # submission
55
  gr.HTML(SUBMISSION_TITLE)
 
16
  SUBMISSION_TITLE,
17
  )
18
  from src.get_results_for_task import get_results_for_task
19
+ from src.leaderboard_formatting import get_types_per_task
20
  from src.submission_uploader import SubmissionUploader
21
  from src.tasks_content import (
22
  TASKS_DESCRIPTIONS,
 
50
  with gr.Row():
51
  gr.Markdown(TASKS_DESCRIPTIONS[TASKS_PRETTY_REVERSE[task_pretty]])
52
 
53
+ leaderboard_table = gr.components.Dataframe(
54
+ value=get_results_for_task(task_pretty),
55
+ interactive=False,
56
+ datatype=get_types_per_task(TASKS_PRETTY_REVERSE[task_pretty]),
57
+ )
58
 
59
  # submission
60
  gr.HTML(SUBMISSION_TITLE)
src/get_results_for_task.py CHANGED
@@ -18,6 +18,7 @@ try:
18
  except FileNotFoundError:
19
  AVAILABLE_TASKS = []
20
 
 
21
  def _get_results_stub() -> pd.DataFrame:
22
  stub_df = pd.DataFrame(
23
  [
 
18
  except FileNotFoundError:
19
  AVAILABLE_TASKS = []
20
 
21
+
22
  def _get_results_stub() -> pd.DataFrame:
23
  stub_df = pd.DataFrame(
24
  [
src/leaderboard_formatting.py CHANGED
@@ -36,3 +36,8 @@ def get_columns_per_task(task_id: str) -> List[str]:
36
  metrics_per_task = METRICS_PER_TASK[task_id]
37
 
38
  return ["Model Name", "Availability", "Context Size"] + metrics_per_task + ["Submitted By"]
 
 
 
 
 
 
36
  metrics_per_task = METRICS_PER_TASK[task_id]
37
 
38
  return ["Model Name", "Availability", "Context Size"] + metrics_per_task + ["Submitted By"]
39
+
40
+
41
+ def get_types_per_task(task_id: str) -> List[str]:
42
+ metrics_per_task = METRICS_PER_TASK.get(task_id, (0, 0, 0, 0, 0))
43
+ return ["html", "markdown", "markdown"] + ["number" for _ in metrics_per_task] + ["markdown"]