Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import os
|
| 2 |
import time
|
| 3 |
-
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
from transformers import AutoTokenizer
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
|
|
@@ -36,7 +38,7 @@ def predict_sentiment(text):
|
|
| 36 |
|
| 37 |
css_str = """
|
| 38 |
.title {
|
| 39 |
-
font-size:
|
| 40 |
font-weight: bold;
|
| 41 |
text-align: center;
|
| 42 |
margin-top: 20px;
|
|
@@ -50,7 +52,7 @@ css_str = """
|
|
| 50 |
"""
|
| 51 |
|
| 52 |
with gr.Blocks(css=css_str) as demo:
|
| 53 |
-
gr.Markdown("<div class='title'>Sentiment
|
| 54 |
gr.Markdown(
|
| 55 |
"<div class='description'>Enter a sentence and see the predicted sentiment.</div>"
|
| 56 |
)
|
|
|
|
| 1 |
import os
|
| 2 |
import time
|
| 3 |
+
|
| 4 |
import gradio as gr
|
| 5 |
+
import torch
|
| 6 |
from transformers import AutoTokenizer
|
| 7 |
+
|
| 8 |
+
from model import get_sentiment, make_model
|
| 9 |
|
| 10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 11 |
|
|
|
|
| 38 |
|
| 39 |
css_str = """
|
| 40 |
.title {
|
| 41 |
+
font-size: 72px;
|
| 42 |
font-weight: bold;
|
| 43 |
text-align: center;
|
| 44 |
margin-top: 20px;
|
|
|
|
| 52 |
"""
|
| 53 |
|
| 54 |
with gr.Blocks(css=css_str) as demo:
|
| 55 |
+
gr.Markdown("<div class='title'>Sentiment Analysis</div>")
|
| 56 |
gr.Markdown(
|
| 57 |
"<div class='description'>Enter a sentence and see the predicted sentiment.</div>"
|
| 58 |
)
|