Spaces:
Runtime error
Runtime error
fix: json result
Browse files
app.py
CHANGED
|
@@ -101,7 +101,7 @@ def analyze(path):
|
|
| 101 |
# drums_path = file_path
|
| 102 |
|
| 103 |
#return result.bpm, fig, sonif_path, elapsed_time
|
| 104 |
-
return result.bpm
|
| 105 |
|
| 106 |
|
| 107 |
with gr.Blocks() as demo:
|
|
@@ -126,7 +126,8 @@ with gr.Blocks() as demo:
|
|
| 126 |
# scale=9,
|
| 127 |
#)
|
| 128 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
| 129 |
-
|
|
|
|
| 130 |
# with gr.Column():
|
| 131 |
# bass = gr.Audio(label='bass', show_share_button=False)
|
| 132 |
# vocals =gr.Audio(label='vocals', show_share_button=False)
|
|
@@ -151,7 +152,7 @@ with gr.Blocks() as demo:
|
|
| 151 |
fn=analyze,
|
| 152 |
inputs=input_audio_path,
|
| 153 |
#outputs=[output_bpm, output_viz, output_sonif, elapsed_time],
|
| 154 |
-
outputs=[output_bpm],
|
| 155 |
api_name='analyze',
|
| 156 |
)
|
| 157 |
|
|
|
|
| 101 |
# drums_path = file_path
|
| 102 |
|
| 103 |
#return result.bpm, fig, sonif_path, elapsed_time
|
| 104 |
+
return result.bpm, elapsed_time, result
|
| 105 |
|
| 106 |
|
| 107 |
with gr.Blocks() as demo:
|
|
|
|
| 126 |
# scale=9,
|
| 127 |
#)
|
| 128 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
| 129 |
+
json_result = gr.JSON(label='JSON Result')
|
| 130 |
+
# json_structure_output = gr.File(label="Json structure")
|
| 131 |
# with gr.Column():
|
| 132 |
# bass = gr.Audio(label='bass', show_share_button=False)
|
| 133 |
# vocals =gr.Audio(label='vocals', show_share_button=False)
|
|
|
|
| 152 |
fn=analyze,
|
| 153 |
inputs=input_audio_path,
|
| 154 |
#outputs=[output_bpm, output_viz, output_sonif, elapsed_time],
|
| 155 |
+
outputs=[output_bpm, elapsed_time, json_result],
|
| 156 |
api_name='analyze',
|
| 157 |
)
|
| 158 |
|