Update app.py
Browse files
app.py
CHANGED
@@ -17,15 +17,15 @@ def get_output(text):
|
|
17 |
model_output = model(**model_input, return_dict=False)
|
18 |
prediction = torch.argmax(model_output[0].cpu(), dim=-1)
|
19 |
prediction = [p.item() for p in prediction]
|
20 |
-
for i in range(len(prediction)):
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
|
27 |
|
28 |
-
return
|
29 |
|
30 |
demo=gr.Interface(fn=get_output,inputs='text',outputs='text')
|
31 |
demo.launch()
|
|
|
17 |
model_output = model(**model_input, return_dict=False)
|
18 |
prediction = torch.argmax(model_output[0].cpu(), dim=-1)
|
19 |
prediction = [p.item() for p in prediction]
|
20 |
+
# for i in range(len(prediction)):
|
21 |
+
# if prediction[i]==0:
|
22 |
+
# output.append("消极")
|
23 |
+
# else:
|
24 |
+
# output.append('积极')
|
25 |
|
26 |
|
27 |
|
28 |
+
return prediction
|
29 |
|
30 |
demo=gr.Interface(fn=get_output,inputs='text',outputs='text')
|
31 |
demo.launch()
|