ubowang commited on
Commit
c80bd67
·
verified ·
1 Parent(s): 163c6d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -2,17 +2,14 @@ from utils import *
2
 
3
  global data_component
4
 
5
-
6
  def update_table(query, min_size, max_size):
7
  df = get_df()
8
  filtered_df = search_and_filter_models(df, query, min_size, max_size)
9
  return filtered_df
10
 
11
-
12
  with gr.Blocks() as block:
13
- gr.Markdown(
14
- LEADERBOARD_INTRODUCTION
15
- )
16
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
17
  # Table 1
18
  with gr.TabItem("📊 MMLU-Pro", elem_id="qa-tab-table1", id=1):
@@ -24,9 +21,7 @@ with gr.Blocks() as block:
24
  elem_id="citation-button",
25
  lines=10,
26
  )
27
- gr.Markdown(
28
- TABLE_INTRODUCTION
29
- )
30
 
31
  with gr.Row():
32
  search_bar = gr.Textbox(
@@ -34,12 +29,9 @@ with gr.Blocks() as block:
34
  show_label=False,
35
  elem_id="search-bar"
36
  )
 
37
  df = get_df()
38
- # min_size, max_size = get_size_range(df)
39
-
40
- numeric_sizes = df[df['Model Size(B)'].apply(lambda x: isinstance(x, (int, float)))]['Model Size(B)']
41
- min_size = numeric_sizes.min() if not numeric_sizes.empty else 0
42
- max_size = numeric_sizes.max() if not numeric_sizes.empty else 1000
43
 
44
  with gr.Row():
45
  min_size_slider = gr.Slider(
@@ -66,6 +58,7 @@ with gr.Blocks() as block:
66
  visible=True,
67
  height=1000
68
  )
 
69
  refresh_button = gr.Button("Refresh")
70
  search_bar.change(fn=update_table, inputs=[search_bar, min_size_slider, max_size_slider], outputs=data_component)
71
  min_size_slider.change(fn=update_table, inputs=[search_bar, min_size_slider, max_size_slider], outputs=data_component)
@@ -81,6 +74,4 @@ with gr.Blocks() as block:
81
  with gr.Row():
82
  gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
83
 
84
-
85
- block.launch(share=True)
86
-
 
2
 
3
  global data_component
4
 
 
5
  def update_table(query, min_size, max_size):
6
  df = get_df()
7
  filtered_df = search_and_filter_models(df, query, min_size, max_size)
8
  return filtered_df
9
 
 
10
  with gr.Blocks() as block:
11
+ gr.Markdown(LEADERBOARD_INTRODUCTION)
12
+
 
13
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
14
  # Table 1
15
  with gr.TabItem("📊 MMLU-Pro", elem_id="qa-tab-table1", id=1):
 
21
  elem_id="citation-button",
22
  lines=10,
23
  )
24
+ gr.Markdown(TABLE_INTRODUCTION)
 
 
25
 
26
  with gr.Row():
27
  search_bar = gr.Textbox(
 
29
  show_label=False,
30
  elem_id="search-bar"
31
  )
32
+
33
  df = get_df()
34
+ min_size, max_size = get_size_range(df)
 
 
 
 
35
 
36
  with gr.Row():
37
  min_size_slider = gr.Slider(
 
58
  visible=True,
59
  height=1000
60
  )
61
+
62
  refresh_button = gr.Button("Refresh")
63
  search_bar.change(fn=update_table, inputs=[search_bar, min_size_slider, max_size_slider], outputs=data_component)
64
  min_size_slider.change(fn=update_table, inputs=[search_bar, min_size_slider, max_size_slider], outputs=data_component)
 
74
  with gr.Row():
75
  gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
76
 
77
+ block.launch(share=True)