import gradio as gr from xlm_emo.classifier import EmotionClassifier io1 = 'huggingface/MilaNLProc/xlm-emo-t' def emotionClassifier(text): ec = EmotionClassifier() translation = ec.predict([text]) res=translation[0] return res inputs = gr.inputs.Textbox(label="Text") outpts=gr.outputs.Textbox(label="Output") #gr.Interface(emotionClassifier, inputs=inputs,outputs=outpts, title='Emotions Analyser',theme='peach').launch() gr.Interface.load(io1, inputs=inputs, title="Emotions Analyser",theme='peach').launch(enable_queue=True)