update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Load your model from your Hugging Face profile
|
| 5 |
classifier = pipeline('text-classification', model='AmirRghp/distilbert-base-uncasedimdb-text-classification')
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 4 |
+
|
| 5 |
+
# Load the tokenizer and model
|
| 6 |
+
tokenizer = AutoTokenizer.from_pretrained('AmirRghp/distilbert-base-uncasedimdb-text-classification')
|
| 7 |
+
model = AutoModelForSequenceClassification.from_pretrained('AmirRghp/distilbert-base-uncasedimdb-text-classification')
|
| 8 |
+
|
| 9 |
+
# Create the pipeline
|
| 10 |
+
classifier = pipeline('text-classification', model=model, tokenizer=tokenizer)
|
| 11 |
|
| 12 |
# Load your model from your Hugging Face profile
|
| 13 |
classifier = pipeline('text-classification', model='AmirRghp/distilbert-base-uncasedimdb-text-classification')
|