Spaces:
Runtime error
Runtime error
Update positioning of tabs
Browse files
app.py
CHANGED
@@ -71,25 +71,11 @@ with demo:
|
|
71 |
|
72 |
Click on one the examples provided to load them into the UI and "Classify".
|
73 |
|
74 |
-
- For text and multimodal classification, provide your 1) prompt with the word you want to be filled in as `[MASK]`, and 2) possible options to be ranked separated by `;`.
|
75 |
- For image classification, provide class options to be ranked separated by `;`.
|
|
|
76 |
"""
|
77 |
)
|
78 |
with gr.Tabs():
|
79 |
-
with gr.TabItem("Zero-Shot Text Classification"):
|
80 |
-
with gr.Row():
|
81 |
-
with gr.Column():
|
82 |
-
text_input = gr.Textbox(label="Prompt")
|
83 |
-
text_options = gr.Textbox(label="Label options (separate by ;)")
|
84 |
-
text_button = gr.Button("Classify")
|
85 |
-
text_dataset = gr.Dataset(
|
86 |
-
components=[text_input, text_options],
|
87 |
-
samples=[
|
88 |
-
["by far the worst movie of the year. This was [MASK]", "negative; positive"],
|
89 |
-
["Lord Voldemort -- in the films; born Tom Marvolo Riddle) is a fictional character and the main antagonist in J.K. Rowling's series of Harry Potter novels. Voldemort first appeared in Harry Potter and the Philosopher's Stone, which was released in 1997. Voldemort appears either in person or in flashbacks in each book and its film adaptation in the series, except the third, Harry Potter and the Prisoner of Azkaban, where he is only mentioned. Question: are tom riddle and lord voldemort the same person? Answer: [MASK]", "no; yes"],
|
90 |
-
]
|
91 |
-
)
|
92 |
-
labels_text = gr.Label(label="Probabilities")
|
93 |
with gr.TabItem("Zero-Shot Image Classification"):
|
94 |
with gr.Row():
|
95 |
with gr.Column():
|
@@ -105,6 +91,20 @@ with demo:
|
|
105 |
)
|
106 |
|
107 |
labels_image = gr.Label(label="Probabilities")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
with gr.TabItem("Zero-Shot MultiModal Classification"):
|
109 |
with gr.Row():
|
110 |
with gr.Column():
|
|
|
71 |
|
72 |
Click on one the examples provided to load them into the UI and "Classify".
|
73 |
|
|
|
74 |
- For image classification, provide class options to be ranked separated by `;`.
|
75 |
+
- For text and multimodal classification, provide your 1) prompt with the word you want to be filled in as `[MASK]`, and 2) possible options to be ranked separated by `;`.
|
76 |
"""
|
77 |
)
|
78 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
with gr.TabItem("Zero-Shot Image Classification"):
|
80 |
with gr.Row():
|
81 |
with gr.Column():
|
|
|
91 |
)
|
92 |
|
93 |
labels_image = gr.Label(label="Probabilities")
|
94 |
+
with gr.TabItem("Zero-Shot Text Classification"):
|
95 |
+
with gr.Row():
|
96 |
+
with gr.Column():
|
97 |
+
text_input = gr.Textbox(label="Prompt")
|
98 |
+
text_options = gr.Textbox(label="Label options (separate by ;)")
|
99 |
+
text_button = gr.Button("Classify")
|
100 |
+
text_dataset = gr.Dataset(
|
101 |
+
components=[text_input, text_options],
|
102 |
+
samples=[
|
103 |
+
["by far the worst movie of the year. This was [MASK]", "negative; positive"],
|
104 |
+
["Lord Voldemort -- in the films; born Tom Marvolo Riddle) is a fictional character and the main antagonist in J.K. Rowling's series of Harry Potter novels. Voldemort first appeared in Harry Potter and the Philosopher's Stone, which was released in 1997. Voldemort appears either in person or in flashbacks in each book and its film adaptation in the series, except the third, Harry Potter and the Prisoner of Azkaban, where he is only mentioned. Question: are tom riddle and lord voldemort the same person? Answer: [MASK]", "no; yes"],
|
105 |
+
]
|
106 |
+
)
|
107 |
+
labels_text = gr.Label(label="Probabilities")
|
108 |
with gr.TabItem("Zero-Shot MultiModal Classification"):
|
109 |
with gr.Row():
|
110 |
with gr.Column():
|