Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,9 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipe
|
|
3 |
import tensorflow as tf
|
4 |
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
|
5 |
|
6 |
-
# Load model directly
|
7 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
8 |
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment")
|
10 |
-
model = AutoModelForSequenceClassification.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment")
|
11 |
# Load pre-trained model and tokenizer
|
12 |
|
13 |
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
|
|
3 |
import tensorflow as tf
|
4 |
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
|
5 |
|
|
|
|
|
6 |
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-xlm-roberta-base-sentiment")
|
8 |
+
model = AutoModelForSequenceClassification.from_pretrained("cardiffnlp/twitter-xlm-roberta-base-sentiment")
|
9 |
# Load pre-trained model and tokenizer
|
10 |
|
11 |
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|