Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
68 |
-
|
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
|
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",
|