Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def Predict(model, tokenizer, text):
|
|
14 |
res = tokenizer(text, padding=True, truncation=True, return_tensors="pt", max_length=512)
|
15 |
res = model(**res)
|
16 |
logits = res.logits.softmax(dim=1)
|
17 |
-
logits = logits.numpy()[0]#.cpu().detach().numpy()[0]
|
18 |
return logits
|
19 |
|
20 |
def Print(logits, dictionary):
|
|
|
14 |
res = tokenizer(text, padding=True, truncation=True, return_tensors="pt", max_length=512)
|
15 |
res = model(**res)
|
16 |
logits = res.logits.softmax(dim=1)
|
17 |
+
logits = logits.detach().numpy()[0]#.cpu().detach().numpy()[0]
|
18 |
return logits
|
19 |
|
20 |
def Print(logits, dictionary):
|