import gradio as gr | |
from transformers import pipeline | |
import os | |
token = os.environ.get("HF_TOKEN") | |
pipe = pipeline("text-classification", model="herzlicemi/37a0-5klk-3rla-0", token=token) | |
def predict(text): | |
return str(pipe(text)) | |
demo = gr.Interface( | |
fn=predict, | |
inputs='text', | |
outputs='text', | |
) | |
demo.launch() |