Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -485,10 +485,16 @@ print('=' * 70)
|
|
| 485 |
print('App start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
| 486 |
print('=' * 70)
|
| 487 |
|
|
|
|
|
|
|
| 488 |
with gr.Blocks() as demo:
|
| 489 |
|
|
|
|
|
|
|
| 490 |
demo.load(reset_demo)
|
| 491 |
|
|
|
|
|
|
|
| 492 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Monster Piano Transformer</h1>")
|
| 493 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Ultra-fast and very well fitted solo Piano music transformer</h1>")
|
| 494 |
gr.HTML("""
|
|
@@ -496,7 +502,7 @@ with gr.Blocks() as demo:
|
|
| 496 |
|
| 497 |
<p>
|
| 498 |
<a href="https://pypi.org/project/monsterpianotransformer/">
|
| 499 |
-
<img src="https://upload.wikimedia.org/wikipedia/commons/6/64/PyPI_logo.svg" alt="PyPI Project">
|
| 500 |
</a> or
|
| 501 |
<a href="https://huggingface.co/spaces/asigalov61/Monster-Piano-Transformer?duplicate=true">
|
| 502 |
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg" alt="Duplicate in Hugging Face">
|
|
@@ -505,8 +511,7 @@ with gr.Blocks() as demo:
|
|
| 505 |
|
| 506 |
for faster execution and endless generation!
|
| 507 |
""")
|
| 508 |
-
|
| 509 |
-
|
| 510 |
#==================================================================================
|
| 511 |
|
| 512 |
final_composition = gr.State([])
|
|
@@ -580,12 +585,18 @@ with gr.Blocks() as demo:
|
|
| 580 |
final_plot_output = gr.Plot(label="Final MIDI plot")
|
| 581 |
final_file_output = gr.File(label="Final MIDI file")
|
| 582 |
|
|
|
|
|
|
|
| 583 |
add_btn.click(add_batch, [batch_number, final_composition, generated_batches, block_lines, model_state],
|
| 584 |
-
[final_audio_output, final_plot_output, final_file_output, final_composition, generated_batches, block_lines])
|
|
|
|
|
|
|
| 585 |
|
| 586 |
remove_btn.click(remove_batch, [batch_number, num_gen_tokens, final_composition, generated_batches, block_lines, model_state],
|
| 587 |
[final_audio_output, final_plot_output, final_file_output, final_composition, generated_batches, block_lines])
|
| 588 |
|
|
|
|
|
|
|
| 589 |
demo.unload(reset_demo)
|
| 590 |
|
| 591 |
#==================================================================================
|
|
|
|
| 485 |
print('App start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
| 486 |
print('=' * 70)
|
| 487 |
|
| 488 |
+
#==================================================================================
|
| 489 |
+
|
| 490 |
with gr.Blocks() as demo:
|
| 491 |
|
| 492 |
+
#==================================================================================
|
| 493 |
+
|
| 494 |
demo.load(reset_demo)
|
| 495 |
|
| 496 |
+
#==================================================================================
|
| 497 |
+
|
| 498 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Monster Piano Transformer</h1>")
|
| 499 |
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Ultra-fast and very well fitted solo Piano music transformer</h1>")
|
| 500 |
gr.HTML("""
|
|
|
|
| 502 |
|
| 503 |
<p>
|
| 504 |
<a href="https://pypi.org/project/monsterpianotransformer/">
|
| 505 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/6/64/PyPI_logo.svg" alt="PyPI Project" style="width: 100px; height: auto;">
|
| 506 |
</a> or
|
| 507 |
<a href="https://huggingface.co/spaces/asigalov61/Monster-Piano-Transformer?duplicate=true">
|
| 508 |
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg" alt="Duplicate in Hugging Face">
|
|
|
|
| 511 |
|
| 512 |
for faster execution and endless generation!
|
| 513 |
""")
|
| 514 |
+
|
|
|
|
| 515 |
#==================================================================================
|
| 516 |
|
| 517 |
final_composition = gr.State([])
|
|
|
|
| 585 |
final_plot_output = gr.Plot(label="Final MIDI plot")
|
| 586 |
final_file_output = gr.File(label="Final MIDI file")
|
| 587 |
|
| 588 |
+
#==================================================================================
|
| 589 |
+
|
| 590 |
add_btn.click(add_batch, [batch_number, final_composition, generated_batches, block_lines, model_state],
|
| 591 |
+
[final_audio_output, final_plot_output, final_file_output, final_composition, generated_batches, block_lines])
|
| 592 |
+
|
| 593 |
+
#==================================================================================
|
| 594 |
|
| 595 |
remove_btn.click(remove_batch, [batch_number, num_gen_tokens, final_composition, generated_batches, block_lines, model_state],
|
| 596 |
[final_audio_output, final_plot_output, final_file_output, final_composition, generated_batches, block_lines])
|
| 597 |
|
| 598 |
+
#==================================================================================
|
| 599 |
+
|
| 600 |
demo.unload(reset_demo)
|
| 601 |
|
| 602 |
#==================================================================================
|