thak123 commited on
Commit
31209f4
1 Parent(s): b3b3581

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
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
- tokenizer = AutoTokenizer.from_pretrained("FFZG-cleopatra/bert-emoji-latvian-twitter")
 
16
 
17
- # classifier = pipeline("sentiment-analysis",
18
- # model= model,
19
- # tokenizer = tokenizer)
 
 
 
 
 
 
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)))