Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,18 @@ import gradio as gr
|
|
12 |
# DEVICE = config.device
|
13 |
|
14 |
model = AutoModel.from_pretrained("thak123/bert-emoji-latvian-twitter-classifier")
|
15 |
-
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
# MODEL = BERTBaseUncased()
|
22 |
# MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
|
|
|
12 |
# DEVICE = config.device
|
13 |
|
14 |
model = AutoModel.from_pretrained("thak123/bert-emoji-latvian-twitter-classifier")
|
15 |
+
# 7 EPOCH Version
|
16 |
+
BERT_PATH = "FFZG-cleopatra/bert-emoji-latvian-twitter"
|
17 |
|
18 |
+
tokenizer = transformers.BertTokenizer.from_pretrained(
|
19 |
+
BERT_PATH,
|
20 |
+
do_lower_case=True
|
21 |
+
)
|
22 |
+
#AutoTokenizer.from_pretrained("FFZG-cleopatra/bert-emoji-latvian-twitter")
|
23 |
+
|
24 |
+
classifier = pipeline("sentiment-analysis",
|
25 |
+
model= model,
|
26 |
+
tokenizer = tokenizer)
|
27 |
|
28 |
# MODEL = BERTBaseUncased()
|
29 |
# MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
|