requirements
Browse files- app.py +3 -4
- requirements.txt +3 -0
app.py
CHANGED
@@ -2,14 +2,13 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
-
model_name = "
|
6 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
mapping = {
|
10 |
-
0: '
|
11 |
-
1: '
|
12 |
-
2: 'fear'
|
13 |
}
|
14 |
|
15 |
def predict(text):
|
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
model_name = "Bittar/NLP_Emotions"
|
6 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
mapping = {
|
10 |
+
0: 'negative',
|
11 |
+
1: 'positive'
|
|
|
12 |
}
|
13 |
|
14 |
def predict(text):
|
requirements.txt
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
torch
|