Spaces:
Running
Running
save_pretrained
Browse files
app.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline, AutoTokenizer, DistilBertForSequenceClassification
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 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)
|