-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (28 loc) · 855 Bytes
/
main.py
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
33
34
from model import PopMusicTransformer
import os
import tensorflow as tf
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
def main():
tf.compat.v1.disable_eager_execution()
# declare model
model = PopMusicTransformer(
checkpoint='/Users/hisham/Downloads/REMI-tempo-chord-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()