sundea commited on
Commit
18efc3c
·
1 Parent(s): fae15ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- if prediction[i]==0:
22
- output.append("消极")
23
- else:
24
- output.append('积极')
25
 
26
 
27
 
28
- return output
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()