Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,10 @@ import numpy as np
|
|
6 |
import pandas as pd
|
7 |
from utils import test_sentences
|
8 |
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
# Gradio μΈν°νμ΄μ€μμ μ¬μ©ν ν¨μ μ μ
|
12 |
def predict_sentiment(text):
|
@@ -24,8 +27,8 @@ description = "βΆνΈμν° κ°μ μμ보기"
|
|
24 |
|
25 |
tweet = gr.Interface(
|
26 |
fn=predict_sentiment,
|
27 |
-
inputs=
|
28 |
-
outputs=
|
29 |
title=title,
|
30 |
theme="finlaymacklon/boxy_violet",
|
31 |
description=description
|
|
|
6 |
import pandas as pd
|
7 |
from utils import test_sentences
|
8 |
|
9 |
+
|
10 |
+
# λͺ¨λΈμ λΆλ¬μ¬ λ map_location=torch.device('cpu')λ‘ μ€μ νμ¬ CPUμ λ‘λν©λλ€.
|
11 |
+
model = torch.load('bert_classification(0.87).pt', map_location=torch.device('cpu'))
|
12 |
+
|
13 |
|
14 |
# Gradio μΈν°νμ΄μ€μμ μ¬μ©ν ν¨μ μ μ
|
15 |
def predict_sentiment(text):
|
|
|
27 |
|
28 |
tweet = gr.Interface(
|
29 |
fn=predict_sentiment,
|
30 |
+
inputs="text",
|
31 |
+
outputs="text",
|
32 |
title=title,
|
33 |
theme="finlaymacklon/boxy_violet",
|
34 |
description=description
|