adeline / app.py
adelinamart's picture
Update app.py
8ed6974 verified
raw
history blame
533 Bytes
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions")
def predict(input):
predictions = pipeline(input)
return input, {p["label"]: p["score"] for p in predictions}
gradio_app = gr.Interface(
predict,
inputs=gr.Textbox(lines=7, label="Info"),
outputs=[gr.Textbox(label="Processed TEXT"), gr.Label(label="Result", num_top_classes=6)],
title="Happy? Or Not?",
)
if __name__ == "__main__":
gradio_app.launch()