Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
tokenizer = AutoTokenizer.from_pretrained("savasy/bert-turkish-text-classification") | |
model = AutoModelForSequenceClassification.from_pretrained("savasy/bert-turkish-text-classification") | |
def classify(text): | |
cls= pipeline("text-classification",model=model, tokenizer=tokenizer) | |
return cls(text)[0]['label'] | |
gr.Interface(fn=classify, inputs=["textbox"], outputs="label").launch() |