n0w0f commited on
Commit
20ef9d6
·
1 Parent(s): b5137f3

fix: show version

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. src/display/formatting.py +17 -0
app.py CHANGED
@@ -5,6 +5,7 @@ from pathlib import Path
5
 
6
  import gradio as gr
7
  from datasets import load_dataset,get_dataset_config_names
 
8
  from gradio_leaderboard import ColumnFilter, Leaderboard, SelectColumns
9
 
10
  from src.about import (
@@ -139,7 +140,9 @@ with demo:
139
  interactive=True
140
  )
141
  with gr.Column(scale=1):
142
- gr.Markdown(f"*Dataset Version: {benchmark_version}*", elem_classes="markdown-text")
 
 
143
 
144
  # Get column types dynamically
145
  column_types = {
 
5
 
6
  import gradio as gr
7
  from datasets import load_dataset,get_dataset_config_names
8
+ from src.display.formatting import benchmark_version_hyperlink, leaderboard_version_hyperlink
9
  from gradio_leaderboard import ColumnFilter, Leaderboard, SelectColumns
10
 
11
  from src.about import (
 
140
  interactive=True
141
  )
142
  with gr.Column(scale=1):
143
+ gr.HTML(benchmark_version_hyperlink(benchmark_version))
144
+ gr.HTML(leaderboard_version_hyperlink(available_versions[0]))
145
+ # gr.Markdown(f"*Dataset Version: {benchmark_version}*", elem_classes="markdown-text")
146
 
147
  # Get column types dynamically
148
  column_types = {
src/display/formatting.py CHANGED
@@ -25,3 +25,20 @@ def has_no_nan_values(df, columns):
25
 
26
  def has_nan_values(df, columns):
27
  return df[columns].isna().any(axis=1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  def has_nan_values(df, columns):
27
  return df[columns].isna().any(axis=1)
28
+
29
+
30
+ def benchmark_version_hyperlink(version):
31
+ """Create a hyperlink for the benchmark version with tooltip info"""
32
+ link = f"https://huggingface.co/datasets/jablonkagroup/MaCBench" #ideally link should have version in the url
33
+ tooltip = "Dataset version is the version of the dataset that is being used for benchmarking in all the models here"
34
+
35
+ return f'<em>Dataset Version: <a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline; text-decoration-style: dotted;" title="{tooltip}">{version}</a></em>'
36
+
37
+
38
+
39
+ def leaderboard_version_hyperlink(version):
40
+ """Create a hyperlink for the benchmark version with tooltip info"""
41
+ link = f"https://huggingface.co/datasets/jablonkagroup/MaCBench-Results" #ideally link should have version in the url
42
+ tooltip = "Select the version of the leaderboard to display. Everytime a new model is added version is updated"
43
+
44
+ return f'<em>Leaderboard Version: <a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline; text-decoration-style: dotted;" title="{tooltip}">{version}</a></em>'