Spaces:
Runtime error
Runtime error
Update app.py
#1
by
barbieheimer
- opened
app.py
CHANGED
@@ -1,3 +1,20 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# here are some examples for sadness, joy, anger, and optimism.
|
2 |
import gradio as gr
|
3 |
|
4 |
+
examples = [
|
5 |
+
["The movie was a bummer."],
|
6 |
+
["I cannot wait to watch all these movies!"],
|
7 |
+
["The ending of the movie really irks me, gives me the ick fr."],
|
8 |
+
["The protagonist seems to have a lot of hope...."]
|
9 |
+
]
|
10 |
+
|
11 |
+
|
12 |
+
# The UI is being generated here.
|
13 |
+
gradio_ui = gr.Interface(
|
14 |
+
fn=predict, # inserting the model here.
|
15 |
+
title="Sentiment Analysis", examples=examples,
|
16 |
+
inputs=gr.inputs.Textbox(lines=5, label="Paste an Article here."),
|
17 |
+
outputs=[gr.outputs.Textbox(label="Label"),gr.outputs.Textbox(label="Score"),],
|
18 |
+
)
|
19 |
+
|
20 |
+
gradio_ui.launch(share=True, debug=False) # launching the model.
|