Update app.py
Browse files
app.py
CHANGED
|
@@ -24,10 +24,14 @@ from midi_to_colab_audio import midi_to_colab_audio
|
|
| 24 |
|
| 25 |
@spaces.GPU
|
| 26 |
def Generate_Rock_Song(input_midi,
|
| 27 |
-
input_freestyle_continuation,
|
| 28 |
input_number_prime_chords,
|
| 29 |
input_use_original_durations,
|
| 30 |
-
input_match_original_pitches_counts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
):
|
| 32 |
|
| 33 |
#===============================================================================
|
|
@@ -44,10 +48,14 @@ def Generate_Rock_Song(input_midi,
|
|
| 44 |
print('Requested settings:')
|
| 45 |
print('=' * 70)
|
| 46 |
print('Input MIDI file name:', fn)
|
| 47 |
-
print('Freestyle continuation:', input_freestyle_continuation)
|
| 48 |
print('Number of prime chords:', input_number_prime_chords)
|
| 49 |
print('Use original durations:', input_use_original_durations)
|
| 50 |
print('Match original pitches counts:', input_match_original_pitches_counts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
print('=' * 70)
|
| 52 |
|
| 53 |
#===============================================================================
|
|
@@ -417,7 +425,8 @@ if __name__ == "__main__":
|
|
| 417 |
output_plot = gr.Plot(label="Output MIDI score plot")
|
| 418 |
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
| 419 |
|
| 420 |
-
run_event = run_btn.click(Generate_Rock_Song, [
|
|
|
|
| 421 |
input_use_original_durations,
|
| 422 |
input_match_original_pitches_counts,
|
| 423 |
input_freestyle_continuation,
|
|
@@ -432,7 +441,8 @@ if __name__ == "__main__":
|
|
| 432 |
[["Sharing The Night Together.kar", 256, True, True, False, 512, 1024, 0.9, 10],
|
| 433 |
["Hotel California.mid", 256, True, True, False, 512, 1024, 0.9, 10],
|
| 434 |
],
|
| 435 |
-
[
|
|
|
|
| 436 |
input_use_original_durations,
|
| 437 |
input_match_original_pitches_counts,
|
| 438 |
input_freestyle_continuation,
|
|
|
|
| 24 |
|
| 25 |
@spaces.GPU
|
| 26 |
def Generate_Rock_Song(input_midi,
|
|
|
|
| 27 |
input_number_prime_chords,
|
| 28 |
input_use_original_durations,
|
| 29 |
+
input_match_original_pitches_counts,
|
| 30 |
+
input_freestyle_continuation,
|
| 31 |
+
input_number_prime_tokens,
|
| 32 |
+
input_number_gen_tokens,
|
| 33 |
+
input_model_temperature,
|
| 34 |
+
input_model_top_k
|
| 35 |
):
|
| 36 |
|
| 37 |
#===============================================================================
|
|
|
|
| 48 |
print('Requested settings:')
|
| 49 |
print('=' * 70)
|
| 50 |
print('Input MIDI file name:', fn)
|
|
|
|
| 51 |
print('Number of prime chords:', input_number_prime_chords)
|
| 52 |
print('Use original durations:', input_use_original_durations)
|
| 53 |
print('Match original pitches counts:', input_match_original_pitches_counts)
|
| 54 |
+
print('Freestyle continuation:', input_freestyle_continuation)
|
| 55 |
+
print('Number of prime tokens:', input_number_prime_tokens)
|
| 56 |
+
print('Number of tokens to generate:', input_number_gen_tokens)
|
| 57 |
+
print('Model temperature:', input_model_temperature)
|
| 58 |
+
print('Model sampling top k value:', input_model_top_k)
|
| 59 |
print('=' * 70)
|
| 60 |
|
| 61 |
#===============================================================================
|
|
|
|
| 425 |
output_plot = gr.Plot(label="Output MIDI score plot")
|
| 426 |
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
| 427 |
|
| 428 |
+
run_event = run_btn.click(Generate_Rock_Song, [input_midi,
|
| 429 |
+
input_number_prime_chords,
|
| 430 |
input_use_original_durations,
|
| 431 |
input_match_original_pitches_counts,
|
| 432 |
input_freestyle_continuation,
|
|
|
|
| 441 |
[["Sharing The Night Together.kar", 256, True, True, False, 512, 1024, 0.9, 10],
|
| 442 |
["Hotel California.mid", 256, True, True, False, 512, 1024, 0.9, 10],
|
| 443 |
],
|
| 444 |
+
[input_midi,
|
| 445 |
+
input_number_prime_chords,
|
| 446 |
input_use_original_durations,
|
| 447 |
input_match_original_pitches_counts,
|
| 448 |
input_freestyle_continuation,
|