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