# songbloom **Repository Path**: alan-ding/songbloom ## Basic Information - **Project Name**: songbloom - **Description**: 一个全新的完整歌曲生成框架 —— SongBloom,它利用了自回归草图绘制和基于扩散的细化交错范式 - **Primary Language**: Python - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/songbloom - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-01-17 - **Last Updated**: 2026-01-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Readme https://www.modelscope.cn/models/AI-ModelScope/SongBloom/summary ### Download model modelscope download --model AI-ModelScope/SongBloom --local_dir ./models/SongBloom ### Inference ```bash set HF_ENDPOINT=https://hf-mirror.com # Default use GPUs dtype as bfloat16 python infer.py --input-jsonl example/test.jsonl # SongBloom also supports flash-attn (optional). To enable it, please install flash-attn (v2.6.3 is used during training) manually and set os.environ['DISABLE_FLASH_ATTN'] = "0" in infer.py:8 ``` - model-name: Specify model version, see the model cards (eg: songbloom_full_150s/songbloom_full_150s_dpo); - local-dir: Dir where the weights and config files are downloaded; - input-jsonl: input raw data; - output-dir: Dir where the output audio saved; - n-samples: How many audios will be generated for each input term; #### 音频格式转换命令(ffmpeg,需提前安装) 截取10秒 + 转换为48kHz + 双通道WAV ffmpeg -i your_song.mp3 -t 10 -ar 48000 -ac 2 style_prompt.wav #### 数据文件说明 {"idx": "001", "lyrics": "[intro][verse]风吹过麦田的浪.夕阳染红了远方.[chorus]我们追着风奔跑.把烦恼都忘掉.[inst][bridge]岁月像一首歌谣.轻轻在耳边绕.[outro]晚安我的梦.明天会更好.", "prompt_wav": "path/to/your_style_10s_48kHz.wav"} 模板使用说明 idx:保持唯一即可,如 001 002,支持批量生成多行样本。 lyrics:直接填入按规范编写的歌词,标签无需换行,句末必须用 .。 prompt_wav:替换为本地 10 秒、48kHz 双通道 WAV 音频的绝对 / 相对路径,路径不含中文和空格。 #### Run ``` set HF_ENDPOINT=https://hf-mirror.com python infer.py ``` #### Run as MCP ``` set HF_ENDPOINT=https://hf-mirror.com python main.py ``` ### Notes - fix gbk encoding infer.py#82 ``` # need specify the encoding in case gbk input_lines = open(input_jsonl, 'r', encoding='utf-8').readlines() ``` - fix ffmpeg missing .dll ``` 确保进入ffmpeg-full-shared\bin,复制以下 5 个核心 DLL 文件: ffmpeg.dll avcodec-60.dll avformat-60.dll avutil-58.dll swresample-4.dll ``` ![alt text](image.png)