Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -150,17 +150,22 @@ def predict(text):
|
|
150 |
# turn predicted id's into actual label names
|
151 |
return([id2label[idx] for idx, label in enumerate(predictions) if label == 1.0])
|
152 |
|
|
|
153 |
|
154 |
|
155 |
-
inp = [gr.Textbox(label='Text or tweet text', placeholder="Insert text")]
|
156 |
-
out = gr.Textbox(label='Output')
|
157 |
-
text_button = gr.Button("Flip")
|
158 |
-
text_button.click(predict, inputs=inp, outputs=out)
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
###############
|
166 |
|
|
|
150 |
# turn predicted id's into actual label names
|
151 |
return([id2label[idx] for idx, label in enumerate(predictions) if label == 1.0])
|
152 |
|
153 |
+
demo = gr.Blocks()
|
154 |
|
155 |
|
|
|
|
|
|
|
|
|
156 |
|
157 |
+
with demo:
|
158 |
+
gr.Markdown(
|
159 |
+
"""
|
160 |
+
# Sentiment text!!!
|
161 |
+
""")
|
162 |
+
inp = [gr.Textbox(label='Text or tweet text', placeholder="Insert text")]
|
163 |
+
out = gr.Textbox(label='Output')
|
164 |
+
text_button = gr.Button("Flip")
|
165 |
+
text_button.click(predict, inputs=inp, outputs=out)
|
166 |
+
|
167 |
+
|
168 |
+
demo.launch()
|
169 |
|
170 |
###############
|
171 |
|