Downloads · 30 days
29
1% of all-time downloads
Mar2Ding/songcomposer_pretrain
songcomposer_pretrain is a text generation model from Mar2Ding. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<p align="center" <b<font size="6"[ACL 2025] SongComposer</font</b <p
Downloads · 30 days
29
1% of all-time downloads
All-time downloads
2.6K
Public
Repo size
33.4 GB
Likes
5
Public
Click a slice to open those files.
.bin16.7 GB · 100%
From the Hugging Face model README
SongComposer is a language large model (LLM) based on InternLM2 for lyric and melody composition in song generation.
We release SongComposer series in two versions:
To load the SongComposer_pretrain model using Transformers, use the following code:
from transformers import AutoTokenizer, AutoModel
ckpt_path = "Mar2Ding/songcomposer_pretrain"
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
prompt = '<bop> Total 7 lines. The first line:可,<D4>,<137>,<79>|惜,<D#4>,<137>,<79>|这,<F4>,<137>,<88>|是,<F4>,<121>,<79>|属,<F4>,<121>,<79>|于,<D#4>,<214>,<88>|你,<D#4>,<141>,<79>|的,<D4>,<130>,<79>|风,<C4>,<151>,<79>|景,<A#3> <F3>,<181><137>,<79>\n'
model.inference_pretrain(prompt, tokenizer)
通过以下的代码加载 SongComposer_pretrain 模型
from transformers import AutoTokenizer, AutoModel
ckpt_path = "Mar2Ding/songcomposer_pretrain"
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
prompt = '<bop> Total 7 lines. The first line:可,<D4>,<137>,<79>|惜,<D#4>,<137>,<79>|这,<F4>,<137>,<88>|是,<F4>,<121>,<79>|属,<F4>,<121>,<79>|于,<D#4>,<214>,<88>|你,<D#4>,<141>,<79>|的,<D4>,<130>,<79>|风,<C4>,<151>,<79>|景,<A#3> <F3>,<181><137>,<79>\n'
model.inference_pretrain(prompt, tokenizer)
The code is licensed under Apache-2.0, while model weights are fully open for academic research and also allow free commercial usage.