Spaces:
Runtime error
Runtime error
import gradio as gr | |
import pickle | |
filename = "Our_Trained_knn_model.pickle" | |
def predict(inp): | |
best_classifiers = pickle.load(open(filename, 'rb')) | |
emotion = best_classifiers.predict(inp) | |
return emotion | |
if __name__ == "__main__": | |
audio = gr.inputs.Audio(source="upload", type="numpy", label=None, optional=False) | |
#gr.Interface(fn=emotion_recognizer, inputs=audio, outputs="text", capture_session=True).launch() | |
iface = gr.Interface(fn=predict, inputs = "audio", outputs = "text") | |
iface.launch(share=True) | |