Update app.py
Browse files
app.py
CHANGED
|
@@ -205,9 +205,9 @@ def Generate_Rock_Song(input_midi,
|
|
| 205 |
with ctx:
|
| 206 |
out = model.generate(x,
|
| 207 |
num_gen_tokens,
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
temperature=
|
| 211 |
return_prime=True,
|
| 212 |
verbose=True)
|
| 213 |
|
|
@@ -234,8 +234,8 @@ def Generate_Rock_Song(input_midi,
|
|
| 234 |
out = model.generate(x,
|
| 235 |
1,
|
| 236 |
filter_logits_fn=top_k,
|
| 237 |
-
filter_kwargs={'k':
|
| 238 |
-
temperature=
|
| 239 |
return_prime=False,
|
| 240 |
verbose=False)
|
| 241 |
|
|
@@ -254,7 +254,7 @@ def Generate_Rock_Song(input_midi,
|
|
| 254 |
song = []
|
| 255 |
|
| 256 |
if input_freestyle_continuation:
|
| 257 |
-
output = generate_continuation(
|
| 258 |
song.extend(output)
|
| 259 |
|
| 260 |
else:
|
|
@@ -279,14 +279,13 @@ def Generate_Rock_Song(input_midi,
|
|
| 279 |
out_seq = generate_tokens(song)
|
| 280 |
|
| 281 |
song.extend(out_seq)
|
| 282 |
-
|
| 283 |
-
#==================================================================
|
| 284 |
|
| 285 |
print('=' * 70)
|
| 286 |
print('Done!')
|
| 287 |
print('=' * 70)
|
| 288 |
|
| 289 |
#===============================================================================
|
|
|
|
| 290 |
print('Rendering results...')
|
| 291 |
|
| 292 |
print('=' * 70)
|
|
@@ -328,8 +327,6 @@ def Generate_Rock_Song(input_midi,
|
|
| 328 |
pitch = ss-544
|
| 329 |
|
| 330 |
song_f.append(['note', time, dur, channel, pitch, velocities[channel], patch])
|
| 331 |
-
|
| 332 |
-
song_f, patches, overflow_patches = TMIDIX.patch_enhanced_score_notes(song_f)
|
| 333 |
|
| 334 |
fn1 = "Guided-Rock-Music-Transformer-Composition"
|
| 335 |
|
|
|
|
| 205 |
with ctx:
|
| 206 |
out = model.generate(x,
|
| 207 |
num_gen_tokens,
|
| 208 |
+
filter_logits_fn=top_k,
|
| 209 |
+
filter_kwargs={'k': input_model_top_k},
|
| 210 |
+
temperature=input_model_temperature,
|
| 211 |
return_prime=True,
|
| 212 |
verbose=True)
|
| 213 |
|
|
|
|
| 234 |
out = model.generate(x,
|
| 235 |
1,
|
| 236 |
filter_logits_fn=top_k,
|
| 237 |
+
filter_kwargs={'k': input_model_top_k},
|
| 238 |
+
temperature=input_model_temperature,
|
| 239 |
return_prime=False,
|
| 240 |
verbose=False)
|
| 241 |
|
|
|
|
| 254 |
song = []
|
| 255 |
|
| 256 |
if input_freestyle_continuation:
|
| 257 |
+
output = generate_continuation(input_number_prime_tokens, input_number_gen_tokens)
|
| 258 |
song.extend(output)
|
| 259 |
|
| 260 |
else:
|
|
|
|
| 279 |
out_seq = generate_tokens(song)
|
| 280 |
|
| 281 |
song.extend(out_seq)
|
|
|
|
|
|
|
| 282 |
|
| 283 |
print('=' * 70)
|
| 284 |
print('Done!')
|
| 285 |
print('=' * 70)
|
| 286 |
|
| 287 |
#===============================================================================
|
| 288 |
+
|
| 289 |
print('Rendering results...')
|
| 290 |
|
| 291 |
print('=' * 70)
|
|
|
|
| 327 |
pitch = ss-544
|
| 328 |
|
| 329 |
song_f.append(['note', time, dur, channel, pitch, velocities[channel], patch])
|
|
|
|
|
|
|
| 330 |
|
| 331 |
fn1 = "Guided-Rock-Music-Transformer-Composition"
|
| 332 |
|