Update app.py
Browse files
app.py
CHANGED
|
@@ -85,15 +85,6 @@ def calculate_column_widths(df):
|
|
| 85 |
return column_widths
|
| 86 |
|
| 87 |
|
| 88 |
-
def filter_df(df, model_name):
|
| 89 |
-
default_val = 'Input the Model Name (fuzzy)'
|
| 90 |
-
if model_name != default_val:
|
| 91 |
-
method_names = [x.split('</a>')[0].split('>')[-1].lower() for x in df['Model Name']]
|
| 92 |
-
flag = [model_name.lower() in name for name in method_names]
|
| 93 |
-
df['TEMP'] = flag
|
| 94 |
-
df = df[df['TEMP'] == True]
|
| 95 |
-
df.pop('TEMP')
|
| 96 |
-
return df
|
| 97 |
|
| 98 |
|
| 99 |
|
|
@@ -102,7 +93,7 @@ def show_results_tab(df):
|
|
| 102 |
|
| 103 |
with gr.Row():
|
| 104 |
model_name = gr.Textbox(
|
| 105 |
-
value='Input the Model Name
|
| 106 |
label='Search Model Name',
|
| 107 |
interactive=True
|
| 108 |
)
|
|
@@ -117,7 +108,7 @@ def show_results_tab(df):
|
|
| 117 |
|
| 118 |
search_box.submit(
|
| 119 |
fn=filter_df,
|
| 120 |
-
inputs=
|
| 121 |
outputs=table
|
| 122 |
)
|
| 123 |
|
|
@@ -126,6 +117,20 @@ def show_results_tab(df):
|
|
| 126 |
def create_interface():
|
| 127 |
model_info, results = findfile()
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
with gr.Blocks() as demo:
|
| 130 |
# title_comp = gr.Markdown(Initial_title)
|
| 131 |
gr.Markdown(MAIN_LEADERBOARD_DESCRIPTION)
|
|
|
|
| 85 |
return column_widths
|
| 86 |
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
|
| 90 |
|
|
|
|
| 93 |
|
| 94 |
with gr.Row():
|
| 95 |
model_name = gr.Textbox(
|
| 96 |
+
value='Input the Model Name',
|
| 97 |
label='Search Model Name',
|
| 98 |
interactive=True
|
| 99 |
)
|
|
|
|
| 108 |
|
| 109 |
search_box.submit(
|
| 110 |
fn=filter_df,
|
| 111 |
+
inputs=search_box
|
| 112 |
outputs=table
|
| 113 |
)
|
| 114 |
|
|
|
|
| 117 |
def create_interface():
|
| 118 |
model_info, results = findfile()
|
| 119 |
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def filter_df(model_name):
|
| 123 |
+
newdf = make_results_tab(model_info, results)
|
| 124 |
+
default_val = 'Input the Model Name'
|
| 125 |
+
if model_name != default_val:
|
| 126 |
+
method_names = [x.split('</a>')[0].split('>')[-1].lower() for x in newdf['Model Name']]
|
| 127 |
+
flag = [model_name.lower() in name for name in method_names]
|
| 128 |
+
newdf['TEMP'] = flag
|
| 129 |
+
newdf = newdf[newdf['TEMP'] == True]
|
| 130 |
+
newdf.pop('TEMP')
|
| 131 |
+
return newdf
|
| 132 |
+
|
| 133 |
+
|
| 134 |
with gr.Blocks() as demo:
|
| 135 |
# title_comp = gr.Markdown(Initial_title)
|
| 136 |
gr.Markdown(MAIN_LEADERBOARD_DESCRIPTION)
|