File size: 709 Bytes
4d95c77 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
from model import PopMusicTransformer
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
def main():
# declare model
model = PopMusicTransformer(
checkpoint='REMI-tempo-checkpoint',
is_training=False)
# generate from scratch
model.generate(
n_target_bar=16,
temperature=1.2,
topk=5,
output_path='./result/from_scratch.midi',
prompt=None)
# generate continuation
model.generate(
n_target_bar=16,
temperature=1.2,
topk=5
output_path='./result/continuation.midi',
prompt='./data/evaluation/000.midi')
# close model
model.close()
if __name__ == '__main__':
main()
|