Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ EXPLANATIONS = {
|
|
52 |
}
|
53 |
|
54 |
def custom_sentiment(text):
|
55 |
-
inputs = sentiment_tokenizer(text, return_tensors
|
56 |
with torch.no_grad():
|
57 |
outputs = sentiment_model(**inputs)
|
58 |
probs = torch.nn.functional.softmax(outputs.logits, dim=1)
|
|
|
52 |
}
|
53 |
|
54 |
def custom_sentiment(text):
|
55 |
+
inputs = sentiment_tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
56 |
with torch.no_grad():
|
57 |
outputs = sentiment_model(**inputs)
|
58 |
probs = torch.nn.functional.softmax(outputs.logits, dim=1)
|