TypeTest / app.py
Guihss's picture
remove share
0759d91
raw
history blame contribute delete
354 Bytes
import gradio as gr
from transformers import pipeline
reader = pipeline("text-classification", model='Guihss/TypeBERT', trust_remote_code=True,
revision='main')
def predict(text):
return {s['label']: s['score'] for s in reader(text, top_k=None)}
iface = gr.Interface(fn=predict, inputs="text", outputs='label')
iface.launch()