Spaces:
Sleeping
Sleeping
Preetham04
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
pipeline = pipeline(task="text-classification", model="Preetham04/
|
5 |
|
6 |
def predict(input_text):
|
7 |
predictions = pipeline(input_text)
|
@@ -15,11 +15,17 @@ def predict(input_text):
|
|
15 |
})
|
16 |
return result
|
17 |
|
|
|
|
|
|
|
|
|
18 |
gradio_app = gr.Interface(
|
19 |
predict,
|
20 |
inputs="textbox",
|
21 |
outputs="text",
|
22 |
title="Sentiment- good or bad?",
|
|
|
|
|
23 |
)
|
24 |
|
25 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
pipeline = pipeline(task="text-classification", model="Preetham04/sentiment-analysis")
|
5 |
|
6 |
def predict(input_text):
|
7 |
predictions = pipeline(input_text)
|
|
|
15 |
})
|
16 |
return result
|
17 |
|
18 |
+
description = """
|
19 |
+
The Bot was trained to answer questions based on Clothing. Ask anything!
|
20 |
+
"""
|
21 |
+
|
22 |
gradio_app = gr.Interface(
|
23 |
predict,
|
24 |
inputs="textbox",
|
25 |
outputs="text",
|
26 |
title="Sentiment- good or bad?",
|
27 |
+
description=description,
|
28 |
+
examples=[["Loved it!!"], ["Bad quality"]],
|
29 |
)
|
30 |
|
31 |
if __name__ == "__main__":
|