Spaces:
Running
Running
badaoui
commited on
Commit
·
e1d7932
1
Parent(s):
e303e0b
fixing ui
Browse files
app.py
CHANGED
@@ -46,7 +46,9 @@ TASK_CATEGORIES = {
|
|
46 |
"inpaint": {"color": "#ec4899", "category": "Multimodal"},
|
47 |
"zero-shot-image-classification": {"color": "#ec4899", "category": "Multimodal"},
|
48 |
"sentence-similarity": {"color": "#06b6d4", "category": "Similarity"},
|
49 |
-
|
|
|
|
|
50 |
"Feature Extraction": {"color": "#3b82f6", "category": "Feature Extraction"},
|
51 |
"NLP": {"color": "#8b5cf6", "category": "NLP"},
|
52 |
"Text Generation": {"color": "#10b981", "category": "Text Generation"},
|
@@ -64,6 +66,9 @@ def create_task_tag(task: str) -> str:
|
|
64 |
if task in TASK_CATEGORIES:
|
65 |
color = TASK_CATEGORIES[task]["color"]
|
66 |
return f'<span style="background-color: {color}; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 1px;">{task}</span>'
|
|
|
|
|
|
|
67 |
else:
|
68 |
return f'<span style="background-color: #6b7280; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 1px;">{task}</span>'
|
69 |
|
@@ -230,8 +235,7 @@ with gr.Blocks(css=CUSTOM_CSS) as demo:
|
|
230 |
input_task = gr.Dropdown(
|
231 |
choices=ALL_TASKS,
|
232 |
value="auto",
|
233 |
-
label='Task',
|
234 |
-
info='Select the task type for your model (auto will infer automatically)',
|
235 |
)
|
236 |
|
237 |
# Export button below the inputs
|
@@ -251,7 +255,6 @@ with gr.Blocks(css=CUSTOM_CSS) as demo:
|
|
251 |
<div style="margin-bottom: 20px;">
|
252 |
<h3>🎨 Task Categories Legend</h3>
|
253 |
<div class="task-tags">
|
254 |
-
{create_task_tag("Auto")}
|
255 |
{create_task_tag("Feature Extraction")}
|
256 |
{create_task_tag("NLP")}
|
257 |
{create_task_tag("Text Generation")}
|
|
|
46 |
"inpaint": {"color": "#ec4899", "category": "Multimodal"},
|
47 |
"zero-shot-image-classification": {"color": "#ec4899", "category": "Multimodal"},
|
48 |
"sentence-similarity": {"color": "#06b6d4", "category": "Similarity"},
|
49 |
+
}
|
50 |
+
|
51 |
+
TAGS = {
|
52 |
"Feature Extraction": {"color": "#3b82f6", "category": "Feature Extraction"},
|
53 |
"NLP": {"color": "#8b5cf6", "category": "NLP"},
|
54 |
"Text Generation": {"color": "#10b981", "category": "Text Generation"},
|
|
|
66 |
if task in TASK_CATEGORIES:
|
67 |
color = TASK_CATEGORIES[task]["color"]
|
68 |
return f'<span style="background-color: {color}; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 1px;">{task}</span>'
|
69 |
+
elif task in TAGS:
|
70 |
+
color = TAGS[task]["color"]
|
71 |
+
return f'<span style="background-color: {color}; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 1px;">{task}</span>'
|
72 |
else:
|
73 |
return f'<span style="background-color: #6b7280; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 1px;">{task}</span>'
|
74 |
|
|
|
235 |
input_task = gr.Dropdown(
|
236 |
choices=ALL_TASKS,
|
237 |
value="auto",
|
238 |
+
label='Task (auto could infer task from model)',
|
|
|
239 |
)
|
240 |
|
241 |
# Export button below the inputs
|
|
|
255 |
<div style="margin-bottom: 20px;">
|
256 |
<h3>🎨 Task Categories Legend</h3>
|
257 |
<div class="task-tags">
|
|
|
258 |
{create_task_tag("Feature Extraction")}
|
259 |
{create_task_tag("NLP")}
|
260 |
{create_task_tag("Text Generation")}
|