Berbex commited on
Commit
24b6e78
Β·
1 Parent(s): 11a0b6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
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
- interface = gr.Interface.load(input=inp,output=out,
161
- title = title,
162
- theme = "peach",
163
- examples = [[text_]]).launch()
 
 
 
 
 
 
 
 
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