Update app.py
Browse files
app.py
CHANGED
@@ -190,6 +190,17 @@ def get_task(rl_env, task_id, path) -> str:
|
|
190 |
else:
|
191 |
return "Task not found"
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
run_update_dataset()
|
194 |
|
195 |
block = gr.Blocks(css=custom_css)
|
@@ -219,10 +230,11 @@ with block:
|
|
219 |
with gr.Tabs() as tabs: # elem_classes="tab-buttons"
|
220 |
for i in range(0, len(hivex_envs)):
|
221 |
hivex_env = hivex_envs[i]
|
222 |
-
with gr.Tab(hivex_env[
|
223 |
# TASK TABS
|
224 |
for j in range(0, hivex_env["task_count"]):
|
225 |
-
|
|
|
226 |
with gr.Row():
|
227 |
gr_dataframe = gr.components.Dataframe(value=get_data(hivex_env["hivex_env"], j, path_), headers=["User", "Model"], datatype=["markdown", "markdown"], row_count=(100, 'fixed'))
|
228 |
|
|
|
190 |
else:
|
191 |
return "Task not found"
|
192 |
|
193 |
+
|
194 |
+
def convert_to_title_case(text: str) -> str:
|
195 |
+
# Replace underscores with spaces
|
196 |
+
text = text.replace("_", " ")
|
197 |
+
|
198 |
+
# Convert each word to title case (capitalize the first letter)
|
199 |
+
title_case_text = text.title()
|
200 |
+
|
201 |
+
return title_case_text
|
202 |
+
|
203 |
+
|
204 |
run_update_dataset()
|
205 |
|
206 |
block = gr.Blocks(css=custom_css)
|
|
|
230 |
with gr.Tabs() as tabs: # elem_classes="tab-buttons"
|
231 |
for i in range(0, len(hivex_envs)):
|
232 |
hivex_env = hivex_envs[i]
|
233 |
+
with gr.Tab(f"{hivex_env['title']}") as env_tabs:
|
234 |
# TASK TABS
|
235 |
for j in range(0, hivex_env["task_count"]):
|
236 |
+
task_title = convert_to_title_case(get_task(hivex_env["hivex_env"], j, path_))
|
237 |
+
with gr.TabItem(f"Task {j}: {task_title}"):
|
238 |
with gr.Row():
|
239 |
gr_dataframe = gr.components.Dataframe(value=get_data(hivex_env["hivex_env"], j, path_), headers=["User", "Model"], datatype=["markdown", "markdown"], row_count=(100, 'fixed'))
|
240 |
|