Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
pipe = pipeline("text-classification", model="Bruno/intent-classification-pt-setfit-model") | |
dictionary={'48':'alarm_set', | |
'46':'audio_volume_mute', | |
'1':'iot_hue_lightchange', | |
'40':'iot_hue_lightoff', | |
'34':'iot_cleaning', | |
} | |
def greet(text, dictionary=dictionary): | |
response = pipe(text) | |
return dictionary[response[0]['label']] | |
demo = gr.Interface(fn=greet, | |
inputs="text", | |
outputs="text", | |
title="Aamzon PT-br Intent Classifier", | |
description="Aamzon PT-br Intent Classifier", | |
examples=[["pausa por dez segundos"],["definir a iluminação adequada para leitura"],["aspirar a casa"]], | |
cache_examples=False) | |
demo.launch() |