Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|
| 11 |
tmp = data
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
| 52 |
|
| 53 |
-
table = gr.Dataframe(
|
| 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 |
|