Views
No views yet
pip install -r requirements.txtpip install torch==2.1.0 --index-url https://download.pytorch.org/whl/cu121abc2midi (from the abcMIDI package), installed at the system
level (macOS: brew install abcmidi; Debian/Ubuntu: apt install abcmidi).config.py). By default
the system targets an OpenAI-compatible aggregation gateway that exposes the five
backends evaluated in the paper (Claude Opus 4.6, GPT-5.2, DeepSeek-V3.2, GLM-4.6,
and MiniMax-M2.5):1export LLM_BASE_URL="https://api.ephone.ai/v1" # or your own OpenAI-compatible endpoint
2export LLM_API_KEY="" # set your key if the endpoint requires one
3export LLM_MODEL="claude-opus-4-6" # switch backend by changing the model idmelody/models/weights_chinese_artsong.pth, or point the
NOTAGEN_WEIGHTS_PATH environment variable to its location.
The model can be fine-tuned by following the procedure described in the paper.abc2midi tool as described above.export NOTAGEN_WEIGHTS_PATH="/absolute/path/to/weights_chinese_artsong.pth"1python main.py "我想要一首有希望的、充满诗意的歌。"
2# Omit the description to enter it interactively:
3python main.py
4
5# Alternatively, use the convenience launcher with the settings in run.sh:
6./run.sh "我想要一首有诗意的、充满希望的歌曲。"output/.config.py Global configuration (LLM access, paths, generation limits)
main.py Command-line entry point
pipeline.py Four-stage composition pipeline
modules/ Emotion analysis, lyric generation, NotaGen interface, conversion
melody/ NotaGen melody model: data, pretrain, finetune, RL, inference, generate.py
requirements.txt Python dependencies
run.sh Convenience launcher