oucgc1996 commited on
Commit
47d88f0
1 Parent(s): 088fd80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -64,10 +64,10 @@ def AMP(file):
64
  for index, batch in enumerate(test_dataloader):
65
  batchs = {k: v for k, v in batch.items()}
66
  predict = model(batchs)
67
- out_probability = np.max(np.array(predict.cpu()),axis=1)
68
- test_argmax = np.argmax(predict.cpu(), axis=1)
69
  id2str = {0:"non-AMP", 1:"AMP"}
70
- return id2str[test_argmax], out_probability
71
 
72
  iface = gr.Interface(fn=AMP,
73
  inputs="text",
 
64
  for index, batch in enumerate(test_dataloader):
65
  batchs = {k: v for k, v in batch.items()}
66
  predict = model(batchs)
67
+ out_probability.extend(np.max(np.array(predict.cpu()),axis=1).tolist())
68
+ test_argmax = np.argmax(predict.cpu(), axis=1).tolist()
69
  id2str = {0:"non-AMP", 1:"AMP"}
70
+ return id2str[test_argmax[0]], out_probability[0]
71
 
72
  iface = gr.Interface(fn=AMP,
73
  inputs="text",