Spaces:
Sleeping
Sleeping
Commit ·
b79d7c8
1
Parent(s): 6aa1eb0
fix bug
Browse files
app.py
CHANGED
|
@@ -6,9 +6,9 @@ device = 0 if torch.cuda.is_available() else -1
|
|
| 6 |
|
| 7 |
sentiment_pipeline = pipeline("sentiment-analysis", device=device)
|
| 8 |
|
| 9 |
-
def
|
| 10 |
return sentiment_pipeline(text)
|
| 11 |
|
| 12 |
-
demo = gr.Interface(fn=
|
| 13 |
|
| 14 |
demo.launch()
|
|
|
|
| 6 |
|
| 7 |
sentiment_pipeline = pipeline("sentiment-analysis", device=device)
|
| 8 |
|
| 9 |
+
def get_sentiment(text):
|
| 10 |
return sentiment_pipeline(text)
|
| 11 |
|
| 12 |
+
demo = gr.Interface(fn=get_sentiment, inputs="text", outputs="json")
|
| 13 |
|
| 14 |
demo.launch()
|