thak123 commited on
Commit
6649164
1 Parent(s): c31bef9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -9,9 +9,11 @@ import sys
9
  from transformers import pipeline, AutoTokenizer, AutoModel
10
  import gradio as gr
11
 
12
- DEVICE = config.device
13
 
14
- classifier = pipeline("sentiment-analysis",model="thak123/bert-emoji-latvian-twitter-classifier", tokenizer = "FFZG-cleopatra/bert-emoji-latvian-twitter")
 
 
15
 
16
  # MODEL = BERTBaseUncased()
17
  # MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
@@ -73,8 +75,7 @@ def sentence_prediction(sentence):
73
  return outputs #{"label":outputs[0]}
74
 
75
  if __name__ == "__main__":
76
-
77
-
78
  demo = gr.Interface(
79
  fn=sentence_prediction,
80
  inputs=gr.Textbox(placeholder="Enter a sentence here..."),
 
9
  from transformers import pipeline, AutoTokenizer, AutoModel
10
  import gradio as gr
11
 
12
+ # DEVICE = config.device
13
 
14
+ classifier = pipeline("sentiment-analysis",
15
+ model= "thak123/bert-emoji-latvian-twitter-classifier",
16
+ tokenizer = "FFZG-cleopatra/bert-emoji-latvian-twitter")
17
 
18
  # MODEL = BERTBaseUncased()
19
  # MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
 
75
  return outputs #{"label":outputs[0]}
76
 
77
  if __name__ == "__main__":
78
+
 
79
  demo = gr.Interface(
80
  fn=sentence_prediction,
81
  inputs=gr.Textbox(placeholder="Enter a sentence here..."),