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