devingulliver commited on
Commit
0ba115a
Β·
verified Β·
1 Parent(s): 38210ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -12
app.py CHANGED
@@ -7,12 +7,16 @@ import gradio as gr
7
  data = pd.read_csv("data.csv")
8
  webhook_url = os.environ.get("WEBHOOK_URL")
9
 
10
- def filter_table(name, type, arch, lcns):
11
  tmp = data
12
- tmp = tmp[tmp["Name"].str.contains(name)]
13
- tmp = tmp[tmp["Type"].isin(type)]
14
- tmp = tmp[tmp["Architecture"].isin(arch)]
15
- tmp = tmp[tmp["License"].isin(lcns)]
 
 
 
 
16
  return tmp
17
 
18
  def submit_model(name):
@@ -43,14 +47,15 @@ with gr.Blocks() as demo:
43
 
44
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
45
  with gr.Tab("πŸ… LLM Benchmark"):
46
- with gr.Row():
47
- namefilter = model_name = gr.Textbox(max_lines=1, placeholder="Search by model name...", show_label=False)
48
- typefilter = gr.Dropdown(label="Filter by model type", multiselect=True, choices=list(set(data["Type"])), value=list(set(data["Type"])))
49
- archfilter = gr.Dropdown(label="Filter by model architecture", multiselect=True, choices=list(set(data["Architecture"])), value=list(set(data["Architecture"])))
50
- lcnsfilter = gr.Dropdown(label="Filter by model license", multiselect=True, choices=list(set(data["License"])), value=list(set(data["License"])))
51
- filter = gr.Button("Filter")
 
52
 
53
- table = gr.Dataframe(data)
54
 
55
  filter.click(fn=filter_table, inputs=[namefilter,typefilter,archfilter,lcnsfilter], outputs=table)
56
 
 
7
  data = pd.read_csv("data.csv")
8
  webhook_url = os.environ.get("WEBHOOK_URL")
9
 
10
+ def filter_table(name, type, arch, license):
11
  tmp = data
12
+ if name:
13
+ tmp = tmp[tmp["Name"].str.contains(name)]
14
+ if type:
15
+ tmp = tmp[tmp["Type"].isin(type)]
16
+ if arch:
17
+ tmp = tmp[tmp["Architecture"].isin(arch)]
18
+ if license:
19
+ tmp = tmp[tmp["License"].isin(license)]
20
  return tmp
21
 
22
  def submit_model(name):
 
47
 
48
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
49
  with gr.Tab("πŸ… LLM Benchmark"):
50
+ with gr.Group():
51
+ with gr.Row():
52
+ namefilter = model_name = gr.Textbox(max_lines=1, placeholder="Search by model name...", show_label=False)
53
+ typefilter = gr.Dropdown(label="Filter by model type", multiselect=True, choices=list(set(data["Type"])), value=["Base","Chat"])
54
+ archfilter = gr.Dropdown(label="Filter by model architecture", multiselect=True, choices=list(set(data["Architecture"])))
55
+ lcnsfilter = gr.Dropdown(label="Filter by model license", multiselect=True, choices=list(set(data["License"])))
56
+ filter = gr.Button("Filter")
57
 
58
+ table = gr.Dataframe(filter_table("",["Base","Chat"],[],[]))
59
 
60
  filter.click(fn=filter_table, inputs=[namefilter,typefilter,archfilter,lcnsfilter], outputs=table)
61