-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevolution_pipeline.py
35 lines (31 loc) · 949 Bytes
/
evolution_pipeline.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
35
from diffusers.utils.testing_utils import enable_full_determinism
from EvoMusic.application import EvoMusic
import torch
import numpy as np
import random
import argparse
import warnings
if __name__ == "__main__":
warnings.filterwarnings("ignore")
enable_full_determinism()
# create argparser
parser = argparse.ArgumentParser(description="Evolve your own personalized music")
parser.add_argument(
"--config_path",
type=str,
default="config.yaml",
help="Path to the configuration file",
)
# seed
parser.add_argument(
"--seed", type=int, default=42, help="Seed for reproducibility"
)
config_path = parser.parse_args().config_path
# Set random seed for reproducibility
seed = parser.parse_args().seed
torch.manual_seed(seed)
np.random.seed(seed)
random.seed(seed)
torch.cuda.seed_all()
app = EvoMusic(config_path)
app.generation_loop(0)