oucgc1996 commited on
Commit
088fd80
1 Parent(s): 84ca719

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -64,12 +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
- # tsne_plot(output_feature,batchs)
68
- out_probability.extend(np.max(np.array(predict.cpu()),axis=1).tolist())
69
- # out_probability.extend(np.array(predict.cpu())[:, -1].tolist())
70
- test_argmax = np.argmax(predict.cpu(), axis=1).tolist()
71
  id2str = {0:"non-AMP", 1:"AMP"}
72
- return id2str[test_argmax[0]], out_probability
73
 
74
  iface = gr.Interface(fn=AMP,
75
  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 = 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",