Update app.py
Browse files
app.py
CHANGED
|
@@ -26,9 +26,9 @@ head_style = """
|
|
| 26 |
</style>
|
| 27 |
"""
|
| 28 |
|
| 29 |
-
|
| 30 |
DATA_URL_BASE = "http://opencompass.oss-cn-shanghai.aliyuncs.com/dev-assets/hf-research/"
|
| 31 |
|
|
|
|
| 32 |
def findfile():
|
| 33 |
model_meta_info = 'model-meta-info'
|
| 34 |
results_sum = 'hf-academic'
|
|
@@ -43,6 +43,8 @@ def findfile():
|
|
| 43 |
|
| 44 |
return model_info, results
|
| 45 |
|
|
|
|
|
|
|
| 46 |
|
| 47 |
MAIN_LEADERBOARD_DESCRIPTION = """## Compass Academic Leaderboard
|
| 48 |
--WIP--
|
|
@@ -89,7 +91,18 @@ def calculate_column_widths(df):
|
|
| 89 |
|
| 90 |
|
| 91 |
def show_results_tab(df):
|
|
|
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
|
| 95 |
with gr.Row():
|
|
@@ -116,19 +129,8 @@ def show_results_tab(df):
|
|
| 116 |
|
| 117 |
|
| 118 |
def create_interface():
|
| 119 |
-
model_info, results = findfile()
|
| 120 |
|
| 121 |
-
|
| 122 |
-
newdf = make_results_tab(model_info, results)
|
| 123 |
-
default_val = 'Input the Model Name'
|
| 124 |
-
if model_name != default_val:
|
| 125 |
-
method_names = [x.split('</a>')[0].split('>')[-1].lower() for x in newdf['Model Name']]
|
| 126 |
-
flag = [model_name.lower() in name for name in method_names]
|
| 127 |
-
newdf['TEMP'] = flag
|
| 128 |
-
newdf = newdf[newdf['TEMP'] == True]
|
| 129 |
-
newdf.pop('TEMP')
|
| 130 |
-
return newdf
|
| 131 |
-
|
| 132 |
with gr.Blocks() as demo:
|
| 133 |
# title_comp = gr.Markdown(Initial_title)
|
| 134 |
gr.Markdown(MAIN_LEADERBOARD_DESCRIPTION)
|
|
|
|
| 26 |
</style>
|
| 27 |
"""
|
| 28 |
|
|
|
|
| 29 |
DATA_URL_BASE = "http://opencompass.oss-cn-shanghai.aliyuncs.com/dev-assets/hf-research/"
|
| 30 |
|
| 31 |
+
|
| 32 |
def findfile():
|
| 33 |
model_meta_info = 'model-meta-info'
|
| 34 |
results_sum = 'hf-academic'
|
|
|
|
| 43 |
|
| 44 |
return model_info, results
|
| 45 |
|
| 46 |
+
model_info, results = findfile()
|
| 47 |
+
|
| 48 |
|
| 49 |
MAIN_LEADERBOARD_DESCRIPTION = """## Compass Academic Leaderboard
|
| 50 |
--WIP--
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
def show_results_tab(df):
|
| 94 |
+
|
| 95 |
|
| 96 |
+
def filter_df(model_name):
|
| 97 |
+
newdf = make_results_tab(model_info, results)
|
| 98 |
+
default_val = 'Input the Model Name'
|
| 99 |
+
if model_name != default_val:
|
| 100 |
+
method_names = [x.split('</a>')[0].split('>')[-1].lower() for x in newdf['Model Name']]
|
| 101 |
+
flag = [model_name.lower() in name for name in method_names]
|
| 102 |
+
newdf['TEMP'] = flag
|
| 103 |
+
newdf = newdf[newdf['TEMP'] == True]
|
| 104 |
+
newdf.pop('TEMP')
|
| 105 |
+
return newdf
|
| 106 |
|
| 107 |
|
| 108 |
with gr.Row():
|
|
|
|
| 129 |
|
| 130 |
|
| 131 |
def create_interface():
|
|
|
|
| 132 |
|
| 133 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
with gr.Blocks() as demo:
|
| 135 |
# title_comp = gr.Markdown(Initial_title)
|
| 136 |
gr.Markdown(MAIN_LEADERBOARD_DESCRIPTION)
|