Spaces:
Runtime error
Runtime error
Commit
·
6ca9fb4
1
Parent(s):
422ea3f
Delete test_pkl.py
Browse files- test_pkl.py +0 -19
test_pkl.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import pickle
|
| 3 |
-
|
| 4 |
-
filename = "Our_Trained_knn_model.pickle"
|
| 5 |
-
|
| 6 |
-
def predict(inp):
|
| 7 |
-
best_classifiers = pickle.load(open(filename, 'rb'))
|
| 8 |
-
emotion = best_classifiers.predict(inp)
|
| 9 |
-
return emotion
|
| 10 |
-
|
| 11 |
-
if __name__ == "__main__":
|
| 12 |
-
audio = gr.inputs.Audio(source="upload", type="numpy", label=None, optional=False)
|
| 13 |
-
|
| 14 |
-
#gr.Interface(fn=emotion_recognizer, inputs=audio, outputs="text", capture_session=True).launch()
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
iface = gr.Interface(fn=predict, inputs = "audio", outputs = "text")
|
| 18 |
-
iface.launch(share=True)
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|