Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,8 @@ def predict(speech):
|
|
| 16 |
audio_classifier = pipeline(
|
| 17 |
task="audio-classification", model="ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition")
|
| 18 |
preds = audio_classifier(audio_file)
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
demo = gr.Interface(fn=predict, inputs='texts' outputs="texts")
|
| 23 |
|
|
|
|
| 16 |
audio_classifier = pipeline(
|
| 17 |
task="audio-classification", model="ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition")
|
| 18 |
preds = audio_classifier(audio_file)
|
| 19 |
+
return [{"score": round(pred["score"], 4), "label": pred["label"]} for pred in preds]
|
| 20 |
+
|
| 21 |
|
| 22 |
demo = gr.Interface(fn=predict, inputs='texts' outputs="texts")
|
| 23 |
|