Pendrokar commited on
Commit
0fd5020
1 Parent(s): 3cee196

from_pretrained

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,7 +1,10 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- pipeline = pipeline(task="text-classification", model="colinryan/hf-deepmoji")
 
 
 
5
 
6
  def predict(deepmoji_analysis):
7
  predictions = pipeline(deepmoji_analysis)
 
1
  import gradio as gr
2
+ from transformers import pipeline, AutoTokenizer, DistilBertForMultilabelSequenceClassification
3
 
4
+ distilTokenizer = AutoTokenizer.from_pretrained("colinryan/hf-deepmoji")
5
+ distilModel = DistilBertForMultilabelSequenceClassification.from_pretrained("colinryan/hf-deepmoji")
6
+
7
+ pipeline = pipeline(task="text-classification", model=distilModel, tokenizer=tokenizer)
8
 
9
  def predict(deepmoji_analysis):
10
  predictions = pipeline(deepmoji_analysis)