heartlib README

项目的 README,来自 github.com/HeartMuLa/heartlib。合并为一个 markdown 文件:README.md。

HeartMuLa

🎵 Try HeartMuLa online → heartmula.com

Demo 🎶  |  📑 Paper
HeartMuLa-oss-3B-happy-new-year 🤗  |  HeartMuLa-oss-3B-happy-new-year
HeartCodec-oss-encoder 🤗  |  MuLaCover GitHub  |  MuLaCover 🤗


HeartMuLa: A Family of Open Sourced Music Foundation Models

HeartMuLa is a family of open sourced music foundation models including:

  1. HeartMuLa: a music language model that generates music conditioned on lyrics and tags with multilingual support covering almost all languages.
  2. HeartCodec: a 12.5 hz music codec with high reconstruction fidelity;
  3. HeartTranscriptor: a whisper-based model specifically tuned for lyrics transcription; Check this page for its usage.
  4. HeartCLAP: an audio–text alignment model that establishes a unified embedding space for music descriptions and cross-modal retrieval.

Below shows the experiment result of our oss-3B version compared with other baselines.


🔥 Highlight

Our latest internal version of HeartMuLa-7B achieves comparable performance with Suno in terms of musicality, fidelity and controllability.

🎵 Want to make songs without setting anything up? Try heartmula.com in your browser.

📰 News

Join on Discord! join discord


🧭 TODOs


🛠️ Local Deployment

⚙️ Environment Setup

We recommend using python=3.10 for local deployment.

💡 No GPU, or not enough VRAM? HeartMuLa also runs online at heartmula.com: free daily credits, nothing to install.

Clone this repo and install locally.

git clone https://github.com/HeartMuLa/heartlib.git
cd heartlib
pip install -e .

Download our pretrained checkpoints from huggingface or modelscope using the following command:

# if you are using huggingface
hf download --local-dir './ckpt' 'HeartMuLa/HeartMuLaGen'
hf download --local-dir './ckpt/HeartMuLa-oss-3B' 'HeartMuLa/HeartMuLa-oss-3B-happy-new-year'
hf download --local-dir './ckpt/HeartCodec-oss' HeartMuLa/HeartCodec-oss-20260123


# if you are using modelscope
modelscope download --model 'HeartMuLa/HeartMuLaGen' --local_dir './ckpt'
modelscope download --model 'HeartMuLa/HeartMuLa-oss-3B-happy-new-year' --local_dir './ckpt/HeartMuLa-oss-3B'
modelscope download --model 'HeartMuLa/HeartCodec-oss-20260123' --local_dir './ckpt/HeartCodec-oss'

After downloading, the ./ckpt subfolder should structure like this:

./ckpt/
├── HeartCodec-oss/
├── HeartMuLa-oss-3B/
├── config.json
├── gen_config.json
└── tokenizer.json

For audio reconstruction, download the separate encoder and decoder checkpoints:

hf download HeartMuLa/HeartCodec-oss-encoder --local-dir ./ckpt/HeartCodec-oss-encoder
hf download HeartMuLa/HeartCodec-oss-20260123 --local-dir ./ckpt/HeartCodec-oss-20260123

See the music reconstruction example for usage.

▶️ Example Usage

To generate music, run:

python ./examples/run_music_generation.py --model_path=./ckpt --version="3B"

By default this command will generate a piece of music conditioned on lyrics and tags provided in ./assets folder. The output music will be saved at ./assets/output.mp3.

FAQs

  1. How to specify lyrics and tags?

    The model will load lyrics from the txt file --lyrics link to (by default ./assets/lyrics.txt). If you would like to use your own lyrics, just modify the content in ./assets/lyrics.txt. If you would like to save your lyrics to another path, e.g. my_awesome_lyrics.txt, remember to input arguments --lyrics my_awesome_lyrics.txt.

    For tags it's basically the same.

  2. CUDA out of memory?

    If you have multi-GPUs (e.g. 2 4090s), we recommend placing the params of HeartMuLa and HeartCodec separately on different devices. You can do it by typing --mula_device cuda:0 --codec_device cuda:1

    If you are running on a single GPU, use --lazy_load true so that modules will be loaded on demand and deleted once inference completed to save GPU memory.

    Still not enough memory? You can make songs with HeartMuLa online at heartmula.com, no GPU needed.

All parameters:

[Intro]

[Verse]
The sun creeps in across the floor
I hear the traffic outside the door
The coffee pot begins to hiss
It is another morning just like this

[Prechorus]
The world keeps spinning round and round
Feet are planted on the ground
I find my rhythm in the sound

[Chorus]
Every day the light returns
Every day the fire burns
We keep on walking down this street
Moving to the same steady beat
It is the ordinary magic that we meet

[Verse]
The hours tick deeply into noon
Chasing shadows,chasing the moon
Work is done and the lights go low
Watching the city start to glow

[Bridge]
It is not always easy,not always bright
Sometimes we wrestle with the night
But we make it to the morning light

[Chorus]
Every day the light returns
Every day the fire burns
We keep on walking down this street
Moving to the same steady beat

[Outro]
Just another day
Every single day

Regarding tags, check this issue for reference. Our different tags are comma-separated without spaces as illustrated below:

piano,happy,wedding,synthesizer,romantic

⚖️ License

This repository is licensed under the Apache 2.0 License.


📚 Citation

@misc{yang2026heartmulafamilyopensourced,
      title={HeartMuLa: A Family of Open Sourced Music Foundation Models}, 
      author={Dongchao Yang and Yuxin Xie and Yuguo Yin and Zheyu Wang and Xiaoyu Yi and Gongxi Zhu and Xiaolong Weng and Zihan Xiong and Yingzhe Ma and Dading Cong and Jingliang Liu and Zihang Huang and Jinghan Ru and Rongjie Huang and Haoran Wan and Peixu Wang and Kuoxi Yu and Helin Wang and Liming Liang and Xianwei Zhuang and Yuanyuan Wang and Haohan Guo and Junjie Cao and Zeqian Ju and Songxiang Liu and Yuewen Cao and Heming Weng and Yuexian Zou},
      year={2026},
      eprint={2601.10547},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2601.10547}, 
}

📬 Contact

If you are interested in HeartMuLa, feel free to reach us at [email protected]. Website: heartmula.com.

Welcome to join us through Discord or our WeChat group.

Our WeChat group now has more than 200 members. To join, scan our team member's QR code below and include HeartMuLa Group Invite in your friend request. We will invite you into the group manually.

Data Collaboration

For data collaboration, please contact us at [email protected].

Join MuLa Labs, Vera Praxis Lab

We are always excited to meet people with a strong interest in audio and music. MuLa Labs has internship openings for candidates who want to build the next generation of music and audio technology. To apply, email your resume or CV, together with a short introduction, to [email protected].

heartlib (HeartMuLa/heartlib)

正在搜索数据库…

这是什么?HeartMuLa 是一套开源的音乐基础模型,可以根据歌词和标签生成音乐,同时还附带编解码器、转录和音频-文本检索等配套模型。
这是一个模型还是一组模型?一共四个模型:主模型 HeartMuLa 音乐生成器,外加 HeartCodec、HeartTranscriptor 和 HeartCLAP 三个配套模型。
怎么把它跑起来?README 里没有安装命令——它链接到一个单独的使用页面,那里说明了如何运行这些模型。
生成一首歌之前需要先装好什么?至少要有 Python 环境,因为仓库本身就是 Python 代码;README 里没有直接列出依赖要求,而是指向了使用页面。
它真的和 Suno 一样好吗?README 声称最新的内部版本 HeartMuLa-7B 在音乐性、保真度和可控性上可与 Suno 相媲美;公开的评测数据是针对开源的 oss-3B 版本的。
有没有应用或 API,还是得接进我自己的流程里?这是一个面向开发者和研究人员的模型仓库——你需要在自己的环境里运行这些模型;没有提到任何应用或托管服务。
它能生成我这种语言的歌曲吗?可以——HeartMuLa 以歌词和标签为条件,支持几乎所有语言,所以非英文歌词也没问题。
HeartCodec、HeartTranscriptor 和 HeartCLAP 到底是干什么的?HeartCodec 是一个 12.5 Hz 的编解码器,能高保真地重建音频;HeartTranscriptor 是基于 whisper 的模型,专门用于歌词转录;HeartCLAP 把音乐和文字描述统一到一个向量嵌入空间,用于跨模态检索。
那我能下载 7B 版本,还是只能用小一点的模型?公开的结果只覆盖开源的 oss-3B 版本,而可与 Suno 媲美的 HeartMuLa-7B 被描述为他们最新的内部版本——所以仓库公开提供的只有 3B 这一档。
作者
HeartMuLa
大小
10.2 MB
星标
3.8K
更新
提交Nov 15
时长
10个月
提交 · 90 天