Spaces:
Build error
Build error
new updates
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_path)
|
|
| 6 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
| 7 |
|
| 8 |
def predict_tweet(tweet):
|
| 9 |
-
inputs = tokenizer(tweet, return_tensors="pt", padding=
|
| 10 |
outputs = model(**inputs)
|
| 11 |
probs = outputs.logits.softmax(dim=-1)
|
| 12 |
sentiment_classes = ['Negative', 'Neutral', 'Positive']
|
|
|
|
| 6 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
| 7 |
|
| 8 |
def predict_tweet(tweet):
|
| 9 |
+
inputs = tokenizer(tweet, return_tensors="pt", padding="max_length", max_length=128)
|
| 10 |
outputs = model(**inputs)
|
| 11 |
probs = outputs.logits.softmax(dim=-1)
|
| 12 |
sentiment_classes = ['Negative', 'Neutral', 'Positive']
|