Spaces:
Running
Running
revert
Browse files
app.py
CHANGED
@@ -1,14 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import pipeline, AutoTokenizer, DistilBertForSequenceClassification
|
3 |
|
4 |
modelName = "colinryan/hf-deepmoji"
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
#
|
|
|
10 |
|
11 |
-
pipeline = pipeline(task="text-classification", model=
|
|
|
12 |
|
13 |
def predict(deepmoji_analysis):
|
14 |
predictions = pipeline(deepmoji_analysis)
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
from transformers import pipeline, AutoTokenizer, DistilBertForSequenceClassification
|
4 |
|
5 |
modelName = "colinryan/hf-deepmoji"
|
6 |
|
7 |
+
#distil_tokenizer = AutoTokenizer.from_pretrained(modelName)
|
8 |
+
#distil_tokenizer.save_pretrained("./model/")
|
9 |
+
#distil_model = DistilBertForSequenceClassification.from_pretrained(modelName, problem_type="multi_label_classification")
|
10 |
+
#distil_model = DistilBertForMultilabelSequenceClassification.from_pretrained("colinryan/hf-deepmoji")
|
11 |
+
#num_labels = len(model.config.id2label)
|
12 |
|
13 |
+
#pipeline = pipeline(task="text-classification", model=distil_model, tokenizer=distil_tokenizer)
|
14 |
+
pipeline = pipeline(task="text-classification", model=modelName)
|
15 |
|
16 |
def predict(deepmoji_analysis):
|
17 |
predictions = pipeline(deepmoji_analysis)
|