Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,11 +167,7 @@ def load_midi(input_midi):
|
|
| 167 |
print('Score hss', len(melody_chords), 'tokens')
|
| 168 |
print('=' * 70)
|
| 169 |
|
| 170 |
-
|
| 171 |
-
return melody_chords
|
| 172 |
-
|
| 173 |
-
else:
|
| 174 |
-
return None
|
| 175 |
|
| 176 |
else:
|
| 177 |
return None
|
|
@@ -179,7 +175,7 @@ def load_midi(input_midi):
|
|
| 179 |
#==================================================================================
|
| 180 |
|
| 181 |
@spaces.GPU
|
| 182 |
-
def
|
| 183 |
model_temperature,
|
| 184 |
model_sampling_top_p
|
| 185 |
):
|
|
@@ -411,7 +407,7 @@ with gr.Blocks() as demo:
|
|
| 411 |
output_plot = gr.Plot(label="MIDI score plot")
|
| 412 |
output_midi = gr.File(label="MIDI file", file_types=[".mid"])
|
| 413 |
|
| 414 |
-
generate_btn.click(
|
| 415 |
[input_midi,
|
| 416 |
model_temperature,
|
| 417 |
model_sampling_top_p
|
|
@@ -433,7 +429,7 @@ with gr.Blocks() as demo:
|
|
| 433 |
output_plot,
|
| 434 |
output_midi
|
| 435 |
],
|
| 436 |
-
|
| 437 |
)
|
| 438 |
|
| 439 |
#==================================================================================
|
|
|
|
| 167 |
print('Score hss', len(melody_chords), 'tokens')
|
| 168 |
print('=' * 70)
|
| 169 |
|
| 170 |
+
return melody_chords
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
else:
|
| 173 |
return None
|
|
|
|
| 175 |
#==================================================================================
|
| 176 |
|
| 177 |
@spaces.GPU
|
| 178 |
+
def Generate_Drums(input_midi,
|
| 179 |
model_temperature,
|
| 180 |
model_sampling_top_p
|
| 181 |
):
|
|
|
|
| 407 |
output_plot = gr.Plot(label="MIDI score plot")
|
| 408 |
output_midi = gr.File(label="MIDI file", file_types=[".mid"])
|
| 409 |
|
| 410 |
+
generate_btn.click(Generate_Drums,
|
| 411 |
[input_midi,
|
| 412 |
model_temperature,
|
| 413 |
model_sampling_top_p
|
|
|
|
| 429 |
output_plot,
|
| 430 |
output_midi
|
| 431 |
],
|
| 432 |
+
Generate_Drums
|
| 433 |
)
|
| 434 |
|
| 435 |
#==================================================================================
|