Spaces:
Running
Running
Commit
Β·
f208a6d
1
Parent(s):
ce249f3
fix conditions
Browse files
app.py
CHANGED
|
@@ -68,18 +68,24 @@ def change_tab(query_param):
|
|
| 68 |
|
| 69 |
def submit_query(single_df, multi_df, text, backends, datatypes, threshold):
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
filtered_single = single_df[
|
| 72 |
single_df["Model π€"].str.contains(text) &
|
| 73 |
single_df["Backend π"].isin(backends) &
|
| 74 |
single_df["Datatype π₯"].isin(datatypes) &
|
| 75 |
-
single_df["Average H4 Score β¬οΈ"] >= threshold
|
| 76 |
]
|
| 77 |
|
| 78 |
filtered_multi = multi_df[
|
| 79 |
multi_df["Model π€"].str.contains(text) &
|
| 80 |
multi_df["Backend π"].isin(backends) &
|
| 81 |
multi_df["Datatype π₯"].isin(datatypes) &
|
| 82 |
-
multi_df["Average H4 Score β¬οΈ"] >= threshold
|
| 83 |
]
|
| 84 |
|
| 85 |
return filtered_single, filtered_multi
|
|
@@ -92,13 +98,11 @@ with demo:
|
|
| 92 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
| 93 |
|
| 94 |
with gr.Row():
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
)
|
| 101 |
-
|
| 102 |
backend_checkboxes = gr.CheckboxGroup(
|
| 103 |
choices=["pytorch", "onnxruntime"],
|
| 104 |
value=["pytorch"],
|
|
@@ -115,13 +119,12 @@ with demo:
|
|
| 115 |
)
|
| 116 |
|
| 117 |
with gr.Row():
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
)
|
| 125 |
|
| 126 |
with gr.Row():
|
| 127 |
submit_button = gr.Button(
|
|
|
|
| 68 |
|
| 69 |
def submit_query(single_df, multi_df, text, backends, datatypes, threshold):
|
| 70 |
|
| 71 |
+
print("submit_query")
|
| 72 |
+
print(text)
|
| 73 |
+
print(backends)
|
| 74 |
+
print(datatypes)
|
| 75 |
+
print(threshold)
|
| 76 |
+
|
| 77 |
filtered_single = single_df[
|
| 78 |
single_df["Model π€"].str.contains(text) &
|
| 79 |
single_df["Backend π"].isin(backends) &
|
| 80 |
single_df["Datatype π₯"].isin(datatypes) &
|
| 81 |
+
(single_df["Average H4 Score β¬οΈ"] >= threshold)
|
| 82 |
]
|
| 83 |
|
| 84 |
filtered_multi = multi_df[
|
| 85 |
multi_df["Model π€"].str.contains(text) &
|
| 86 |
multi_df["Backend π"].isin(backends) &
|
| 87 |
multi_df["Datatype π₯"].isin(datatypes) &
|
| 88 |
+
(multi_df["Average H4 Score β¬οΈ"] >= threshold)
|
| 89 |
]
|
| 90 |
|
| 91 |
return filtered_single, filtered_multi
|
|
|
|
| 98 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
| 99 |
|
| 100 |
with gr.Row():
|
| 101 |
+
search_bar = gr.Textbox(
|
| 102 |
+
label="Search π",
|
| 103 |
+
info="Search for a model and press Submit π",
|
| 104 |
+
elem_id="search-bar",
|
| 105 |
+
)
|
|
|
|
|
|
|
| 106 |
backend_checkboxes = gr.CheckboxGroup(
|
| 107 |
choices=["pytorch", "onnxruntime"],
|
| 108 |
value=["pytorch"],
|
|
|
|
| 119 |
)
|
| 120 |
|
| 121 |
with gr.Row():
|
| 122 |
+
threshold_slider = gr.Slider(
|
| 123 |
+
label="H4 Threshold π",
|
| 124 |
+
info="Filter by average H4 score",
|
| 125 |
+
value=0.0,
|
| 126 |
+
elem_id="threshold-slider",
|
| 127 |
+
)
|
|
|
|
| 128 |
|
| 129 |
with gr.Row():
|
| 130 |
submit_button = gr.Button(
|