Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def predict(title, summary, tokenizer, model):
|
|
18 |
text = title + "\n" + summary
|
19 |
tokens = tokenizer.encode(text)
|
20 |
with torch.no_grad():
|
21 |
-
logits = model(torch.as_tensor([tokens]
|
22 |
probs = torch.softmax(logits[-1, :], dim=-1).data.cpu().numpy()
|
23 |
|
24 |
classes = np.flip(np.argsort(probs))
|
|
|
18 |
text = title + "\n" + summary
|
19 |
tokens = tokenizer.encode(text)
|
20 |
with torch.no_grad():
|
21 |
+
logits = model(torch.as_tensor([tokens]))[0]
|
22 |
probs = torch.softmax(logits[-1, :], dim=-1).data.cpu().numpy()
|
23 |
|
24 |
classes = np.flip(np.argsort(probs))
|