Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,9 +16,9 @@ labels = learn.dls.vocab
|
|
16 |
def predict(Record, Upload):
|
17 |
if Upload: path = Upload
|
18 |
else: path = Record
|
19 |
-
pred,pred_idx,probs = learn.predict(str(path))
|
20 |
|
21 |
-
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
22 |
|
23 |
|
24 |
title = "Japanese Pitch Accent Pattern Detector"
|
@@ -33,4 +33,4 @@ examples = [['代わる.mp3'],['大丈夫な.mp3'],['熱くない.mp3']]
|
|
33 |
|
34 |
enable_queue=True
|
35 |
|
36 |
-
gr.Interface(fn=predict,inputs=[gr.inputs.Audio(source='microphone', type='filepath', optional=True), gr.inputs.Audio(source='upload', type='filepath', optional=True)]
|
|
|
16 |
def predict(Record, Upload):
|
17 |
if Upload: path = Upload
|
18 |
else: path = Record
|
19 |
+
spec,pred,pred_idx,probs = learn.predict(str(path), with_input=True)
|
20 |
|
21 |
+
return [{labels[i]: float(probs[i]) for i in range(len(labels))},spec]
|
22 |
|
23 |
|
24 |
title = "Japanese Pitch Accent Pattern Detector"
|
|
|
33 |
|
34 |
enable_queue=True
|
35 |
|
36 |
+
gr.Interface(fn=predict,inputs=[gr.inputs.Audio(source='microphone', type='filepath', optional=True), gr.inputs.Audio(source='upload', type='filepath', optional=True)], outputs= [gr.outputs.Label(num_top_classes=3) 'image'], title=title,description=description,article=article,examples=examples).launch(debug=True,share=True,enable_queue=enable_queue)
|