Spaces:
Sleeping
Sleeping
File size: 496 Bytes
3fca0cc da84e83 3a55f68 5060f80 397d14c 5060f80 397d14c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#pip install gradio
#pip3 install torch
#pip install transformers --upgrade
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
ckpt = 'mrm8488/distilroberta-finetuned-banking77'
tokenizer = AutoTokenizer.from_pretrained(ckpt)
model = AutoModelForSequenceClassification.from_pretrained(ckpt)
classifier = pipeline('text-classification', tokenizer=tokenizer, model=model)
demo= gr.Interface.from_pipeline(classifier)
demo.launch(share=True) |