Vineedhar commited on
Commit
b9de071
·
verified ·
1 Parent(s): e5b0a02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
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)