Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
492c93e
1
Parent(s):
995d9de
Refactor submit_gradio_module to improve layout and enhance model submission functionality
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ def search_leaderboard(model_name, columns_to_show):
|
|
72 |
def main():
|
73 |
global df, original_columns_order
|
74 |
df = load_retrieval_results()
|
75 |
-
df[["Model"]] = df[["Model"]].
|
76 |
df.drop(columns=["Revision", "Precision", "Task"], inplace=True)
|
77 |
df.sort_values("Web Search Dataset (Overall Score)", ascending=False, inplace=True)
|
78 |
|
@@ -117,7 +117,8 @@ def main():
|
|
117 |
outputs=retrieval_leaderboard
|
118 |
)
|
119 |
|
120 |
-
|
|
|
121 |
|
122 |
with gr.Tab("Reranking"):
|
123 |
with gr.Tabs():
|
@@ -141,7 +142,10 @@ def main():
|
|
141 |
inputs=search_box_reranker,
|
142 |
outputs=reranker_leaderboard
|
143 |
)
|
144 |
-
|
|
|
|
|
|
|
145 |
|
146 |
# with gr.Tab("LLM Context Answering"):
|
147 |
# with gr.Tabs():
|
|
|
72 |
def main():
|
73 |
global df, original_columns_order
|
74 |
df = load_retrieval_results()
|
75 |
+
df[["Model"]] = df[["Model"]].map(lambda x: f'<a href="https://huggingface.co/{x}" target="_blank">{x}</a>')
|
76 |
df.drop(columns=["Revision", "Precision", "Task"], inplace=True)
|
77 |
df.sort_values("Web Search Dataset (Overall Score)", ascending=False, inplace=True)
|
78 |
|
|
|
117 |
outputs=retrieval_leaderboard
|
118 |
)
|
119 |
|
120 |
+
with gr.Tab("Submit Retriever"):
|
121 |
+
submit_gradio_module("Retriever")
|
122 |
|
123 |
with gr.Tab("Reranking"):
|
124 |
with gr.Tabs():
|
|
|
142 |
inputs=search_box_reranker,
|
143 |
outputs=reranker_leaderboard
|
144 |
)
|
145 |
+
|
146 |
+
with gr.Tab("Submit Reranker"):
|
147 |
+
submit_gradio_module("Reranker")
|
148 |
+
|
149 |
|
150 |
# with gr.Tab("LLM Context Answering"):
|
151 |
# with gr.Tabs():
|
utils.py
CHANGED
@@ -185,87 +185,84 @@ def load_requests(status_folder):
|
|
185 |
|
186 |
def submit_gradio_module(task_type):
|
187 |
var = gr.State(value=task_type)
|
188 |
-
with gr.
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
interactive=False,
|
218 |
-
)
|
219 |
-
num_downloads_input = gr.Textbox(
|
220 |
-
label="Number of Downloads",
|
221 |
-
interactive=False,
|
222 |
-
)
|
223 |
-
num_likes_input = gr.Textbox(
|
224 |
-
label="Number of Likes",
|
225 |
-
interactive=False,
|
226 |
-
)
|
227 |
-
|
228 |
-
submit_button = gr.Button("Submit Model", variant="primary")
|
229 |
-
submission_result = gr.Markdown()
|
230 |
-
fetch_outputs = [precision_input, license_input, params_input, num_downloads_input, num_likes_input]
|
231 |
-
|
232 |
-
fetch_data_button.click(
|
233 |
-
fetch_model_information,
|
234 |
-
inputs=[model_name_input],
|
235 |
-
outputs=fetch_outputs
|
236 |
)
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
outputs=fetch_outputs
|
241 |
)
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
outputs=submission_result
|
246 |
)
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
df_failed = load_requests('failed')
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
270 |
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
def submit_gradio_module(task_type):
|
187 |
var = gr.State(value=task_type)
|
188 |
+
with gr.Row(equal_height=True):
|
189 |
+
model_name_input = gr.Textbox(
|
190 |
+
label="Model",
|
191 |
+
placeholder="Enter the full model name from HuggingFace Hub (e.g., intfloat/multilingual-e5-large-instruct)",
|
192 |
+
scale=4,
|
193 |
+
)
|
194 |
+
fetch_data_button = gr.Button(value="Auto Fetch Model Info", variant="secondary")
|
195 |
+
|
196 |
+
with gr.Row():
|
197 |
+
precision_input = gr.Dropdown(
|
198 |
+
choices=["F16", "F32", "BF16", "I8", "U8", "I16"],
|
199 |
+
label="Precision",
|
200 |
+
value="F16"
|
201 |
+
)
|
202 |
+
license_input = gr.Textbox(
|
203 |
+
label="License",
|
204 |
+
placeholder="Enter the license type (Generic one is 'Open' in case no License is provided)",
|
205 |
+
value="Open"
|
206 |
+
)
|
207 |
+
revision_input = gr.Textbox(
|
208 |
+
label="Revision",
|
209 |
+
placeholder="main",
|
210 |
+
value="main"
|
211 |
+
)
|
212 |
+
|
213 |
+
with gr.Row():
|
214 |
+
params_input = gr.Textbox(
|
215 |
+
label="Params (in Millions)",
|
216 |
+
interactive=False,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
)
|
218 |
+
num_downloads_input = gr.Textbox(
|
219 |
+
label="Number of Downloads",
|
220 |
+
interactive=False,
|
|
|
221 |
)
|
222 |
+
num_likes_input = gr.Textbox(
|
223 |
+
label="Number of Likes",
|
224 |
+
interactive=False,
|
|
|
225 |
)
|
226 |
+
|
227 |
+
submit_button = gr.Button("Submit Model", variant="primary")
|
228 |
+
submission_result = gr.Markdown()
|
229 |
+
fetch_outputs = [precision_input, license_input, params_input, num_downloads_input, num_likes_input]
|
|
|
230 |
|
231 |
+
fetch_data_button.click(
|
232 |
+
fetch_model_information,
|
233 |
+
inputs=[model_name_input],
|
234 |
+
outputs=fetch_outputs
|
235 |
+
)
|
236 |
+
model_name_input.submit(
|
237 |
+
fetch_model_information,
|
238 |
+
inputs=[model_name_input],
|
239 |
+
outputs=fetch_outputs
|
240 |
+
)
|
241 |
+
submit_button.click(
|
242 |
+
submit_model,
|
243 |
+
inputs=[model_name_input, revision_input, precision_input, params_input, license_input, var],
|
244 |
+
outputs=submission_result
|
245 |
+
)
|
246 |
+
|
247 |
+
# Load pending, finished, and failed requests
|
248 |
+
df_pending = load_requests('pending')
|
249 |
+
df_finished = load_requests('finished')
|
250 |
+
df_failed = load_requests('failed')
|
251 |
|
252 |
+
# Display the tables
|
253 |
+
gr.Markdown("## Evaluation Status")
|
254 |
+
with gr.Accordion(f"Pending Evaluations ({len(df_pending)})", open=False):
|
255 |
+
if not df_pending.empty:
|
256 |
+
gr.Dataframe(df_pending)
|
257 |
+
else:
|
258 |
+
gr.Markdown("No pending evaluations.")
|
259 |
+
with gr.Accordion(f"Finished Evaluations ({len(df_finished)})", open=False):
|
260 |
+
if not df_finished.empty:
|
261 |
+
gr.Dataframe(df_finished)
|
262 |
+
else:
|
263 |
+
gr.Markdown("No finished evaluations.")
|
264 |
+
with gr.Accordion(f"Failed Evaluations ({len(df_failed)})", open=False):
|
265 |
+
if not df_failed.empty:
|
266 |
+
gr.Dataframe(df_failed)
|
267 |
+
else:
|
268 |
+
gr.Markdown("No failed evaluations.")
|