Pendrokar commited on
Commit
11c4f8e
1 Parent(s): b2eb1be

save_pretrained

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,8 +1,11 @@
1
  import gradio as gr
2
  from transformers import pipeline, AutoTokenizer, DistilBertForSequenceClassification
3
 
4
- distilTokenizer = AutoTokenizer.from_pretrained("colinryan/hf-deepmoji")
5
- distilModel = DistilBertForSequenceClassification.from_pretrained("colinryan/hf-deepmoji", problem_type="multi_label_classification", num_labels=10)
 
 
 
6
  #distilModel = DistilBertForMultilabelSequenceClassification.from_pretrained("colinryan/hf-deepmoji")
7
 
8
  pipeline = pipeline(task="text-classification", model=distilModel, tokenizer=tokenizer)
 
1
  import gradio as gr
2
  from transformers import pipeline, AutoTokenizer, DistilBertForSequenceClassification
3
 
4
+ modelName = "colinryan/hf-deepmoji"
5
+
6
+ distilTokenizer = AutoTokenizer.from_pretrained(modelName)
7
+ distilTokenizer.save_pretrained("./model/")
8
+ distilModel = DistilBertForSequenceClassification.from_pretrained(modelName, problem_type="multi_label_classification", num_labels=64)
9
  #distilModel = DistilBertForMultilabelSequenceClassification.from_pretrained("colinryan/hf-deepmoji")
10
 
11
  pipeline = pipeline(task="text-classification", model=distilModel, tokenizer=tokenizer)