Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from setfit import SetFitModel | |
| l6_model = SetFitModel.from_pretrained("Bruno/intent-classification-pt-setfit-model") | |
| st.title("A intenção classificada é") | |
| Text = st.text_input("Enter the sentence") | |
| def model_inference(text): | |
| prediction = l6_model([text]) | |
| if prediction == 48: | |
| return "alarm_set" | |
| if prediction == 46: | |
| return "audio_volume_mute" | |
| if prediction == 1: | |
| return "iot_hue_lightchange" | |
| if prediction == 40: | |
| return "iot_hue_lightoff" | |
| if prediction == 34: | |
| return "iot_cleaning" | |
| else: | |
| return "Others" | |
| st.subheader('A intenção classificada é') | |
| st.write(model_inference(Text)) |