Marcelo Lotif commited on
Commit
8471f6d
·
1 Parent(s): 120beea

Making table links work

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. src/display/css_html_js.py +11 -0
app.py CHANGED
@@ -12,7 +12,7 @@ from src.about import (
12
  LLM_BENCHMARKS_TEXT,
13
  TITLE,
14
  )
15
- from src.display.css_html_js import custom_css
16
  from src.display.utils import (
17
  COLS,
18
  ST_BENCHMARK_COLS,
@@ -77,6 +77,7 @@ white_logo_path = "src/assets/logo-icon-white.png"
77
 
78
  demo = gr.Blocks(
79
  css=custom_css,
 
80
  theme=gr.themes.Default(primary_hue=gr.themes.colors.pink),
81
  fill_height=True,
82
  fill_width=True,
 
12
  LLM_BENCHMARKS_TEXT,
13
  TITLE,
14
  )
15
+ from src.display.css_html_js import custom_css, custom_js
16
  from src.display.utils import (
17
  COLS,
18
  ST_BENCHMARK_COLS,
 
77
 
78
  demo = gr.Blocks(
79
  css=custom_css,
80
+ js=custom_js,
81
  theme=gr.themes.Default(primary_hue=gr.themes.colors.pink),
82
  fill_height=True,
83
  fill_width=True,
src/display/css_html_js.py CHANGED
@@ -214,6 +214,17 @@
214
  # line-height: 1.6;
215
  # }
216
  # """
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  custom_css = """
219
 
 
214
  # line-height: 1.6;
215
  # }
216
  # """
217
+ custom_js = """
218
+ function tableLinkHack() {
219
+ // This is a hack to make the table links work
220
+ var allTableLinks = document.querySelectorAll(".llm-benchmark-tab-table .table-wrap table.table a")
221
+ for (var link of allTableLinks) {
222
+ link.addEventListener("click", e => {
223
+ window.open(e.target.href, e.target.target);
224
+ });
225
+ }
226
+ }
227
+ """
228
 
229
  custom_css = """
230