Views
No views yet
1conda create -n sqgen python=3.10
2conda activate sqgen1# CUDA 11.8
2conda install pytorch==2.3.0 pytorch-cuda=11.8 -c pytorch -c nvidia
3
4# CUDA 12.1
5conda install pytorch==2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidiapip install -r requirements.txt1# Install Mamba SSM
2cd mamba/
3pip install -e .
4
5# Install Causal Conv1D
6cd ../causal-conv1d/
7pip install -e .
8
9cd ..1cd generation/
2python test_env.pysqgen/
├── core/ # Core model implementation
│ ├── model.py # SQGen model based on Mamba2
│ ├── config.py # Model configuration class
│ └── utils.py # Patchilizer and utility functions
│
├── training/ # Training scripts
│ ├── pretrain/ # Pretraining stage
│ │ ├── train.py
│ │ └── config.py
│ ├── finetune/ # Finetuning stage
│ │ ├── train.py
│ │ └── config.py
│ └── optimization/ # Reinforcement learning optimization stage
│ ├── train.py
│ ├── config.py
│ ├── data.py
│ └── utils.py
│
├── generation/ # Music generation
│ ├── generate.py # Main generation script
│ ├── config.py # Generation configuration
│ ├── utils.py # Generation utilities
│ ├── test_env.py # Environment test
│ └── test_gpu.py # GPU inference test
│
├── evaluation/ # Evaluation tools
│ └── clamp2/ # CLaMP-2 reward model
│ ├── extract_clamp2.py
│ ├── statistics.py
│ ├── config.py
│ └── utils.py
│
├── data/ # Data processing
│ ├── 1_batch_xml2abc.py # MusicXML to ABC
│ ├── 2_data_preprocess.py # Data preprocessing
│ ├── 3_batch_abc2xml.py # ABC to MusicXML
│ ├── abc2xml.py # ABC parser
│ └── xml2abc.py # XML parser
│
├── scripts/ # Utility scripts
│ ├── create_data_index.py # Create data index
│ ├── create_string_quartet_index.py
│ └── organize_by_key.py
│
├── mamba/ # Mamba SSM library
├── causal-conv1d/ # Causal convolution library
├── requirements.txt # Python dependencies
└── README.md1X:1
2T:String Quartet - Classical
3C:Mozart
4M:4/4
5L:1/8
6Q:1/4=120
7K:C
8V:1 violin1
9V:2 violin2
10V:3 viola
11V:4 cello
12[V:1]|: G2AB c2d2 | e2dc B2A2 | G2FE D2E2 | F2ED C4 :|
13[V:2]|: E2FG A2B2 | c2BA G2F2 | E2DC B,2C2 | D2CB, A,4 :|
14[V:3]|: C2DE F2G2 | A2GF E2D2 | C2BA, G,2A,2 | B,2A,G, F,4 :|
15[V:4]|: C,2D,E, F,2G,2 | A,2G,F, E,2D,2 | C,2B,,A,, G,,2A,,2 | B,,2A,,G,, F,,4 :|
16......