TypeTest / app.py
Guihss's picture
first commit
160f7dd
raw
history blame
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()