Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,14 +5,14 @@ from transformers import RobertaTokenizer, RobertaForSequenceClassification
|
|
| 5 |
# Loading the pre-trained models and tokenizers from Hugging Face Hub
|
| 6 |
sentiment_model = RobertaForSequenceClassification.from_pretrained("yestechies/fine_tuned_roberta_weighted")
|
| 7 |
sentiment_tokenizer = RobertaTokenizer.from_pretrained("yestechies/fine_tuned_roberta_weighted")
|
| 8 |
-
emotion_model = RobertaForSequenceClassification.from_pretrained("yestechies/emotion_model")
|
| 9 |
-
emotion_tokenizer = RobertaTokenizer.from_pretrained("yestechies/emotion_model")
|
| 10 |
-
intention_model = RobertaForSequenceClassification.from_pretrained("yestechies/intention_model")
|
| 11 |
-
intention_tokenizer = RobertaTokenizer.from_pretrained("yestechies/intention_model")
|
| 12 |
|
| 13 |
sentiment_model.eval()
|
| 14 |
-
emotion_model.eval()
|
| 15 |
-
intention_model.eval()
|
| 16 |
|
| 17 |
def predict_label(text, model, tokenizer, id2label):
|
| 18 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|
|
|
|
| 5 |
# Loading the pre-trained models and tokenizers from Hugging Face Hub
|
| 6 |
sentiment_model = RobertaForSequenceClassification.from_pretrained("yestechies/fine_tuned_roberta_weighted")
|
| 7 |
sentiment_tokenizer = RobertaTokenizer.from_pretrained("yestechies/fine_tuned_roberta_weighted")
|
| 8 |
+
#emotion_model = RobertaForSequenceClassification.from_pretrained("yestechies/emotion_model")
|
| 9 |
+
#emotion_tokenizer = RobertaTokenizer.from_pretrained("yestechies/emotion_model")
|
| 10 |
+
#intention_model = RobertaForSequenceClassification.from_pretrained("yestechies/intention_model")
|
| 11 |
+
#intention_tokenizer = RobertaTokenizer.from_pretrained("yestechies/intention_model")
|
| 12 |
|
| 13 |
sentiment_model.eval()
|
| 14 |
+
#emotion_model.eval()
|
| 15 |
+
#intention_model.eval()
|
| 16 |
|
| 17 |
def predict_label(text, model, tokenizer, id2label):
|
| 18 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
|