music generation model
Overview
Highlights
- Permissive Apache-2.0 license for commercial deployment
- Generates diverse musical styles and structures
- Ideal for dynamic game audio and content tools
- Scalable integration via standard audio pipelines
Usage
# Install Hugging Face transformers
pip install transformers torch
# Load model with transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("nagayama0706/music_generation_model")
tokenizer = AutoTokenizer.from_pretrained("nagayama0706/music_generation_model")
Hugging Face Download
We recommend downloading the model via the Hugging Face CLI or Hub SDK.
Guidance:Before downloading, install huggingface_hub with:
pip install -U huggingface_hub
CLI Download
Download the full repository
huggingface-cli download nagayama0706/music_generation_model
Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download nagayama0706/music_generation_model config.json --local-dir ./dir
See the official docs for more CLI options
SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('nagayama0706/music_generation_model')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://huggingface.co/nagayama0706/music_generation_model
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/nagayama0706/music_generation_model
Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.
PyTorch / Transformers Usage
Install Transformers
pip install -U transformers torch
Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('nagayama0706/music_generation_model')
tokenizer = AutoTokenizer.from_pretrained('nagayama0706/music_generation_model')
Full Documentation
---
tags:
- merge
- mergekit
- lazymergekit
- TheBloke/openchat_3.5-GPTQ
- asigalov61/Allegro-Music-Transformer
base_model:
- TheBloke/openchat_3.5-GPTQ
- asigalov61/Allegro-Music-Transformer
license: apache-2.0
pipeline_tag: text-to-audio
---
music_generation_model
music_generation_model is a merge of the following models using LazyMergekit:
🧩 Configuration
slices:
- sources:
- model: TheBloke/openchat_3.5-GPTQ
layer_range: [0, 32]
- model: asigalov61/Allegro-Music-Transformer
layer_range: [0, 32]
merge_method: slerp
base_model: TheBloke/openchat_3.5-GPTQ
parameters:
t:
- filter: self_attn
value: [0, 0.5, 0.3, 0.7, 1]
- filter: mlp
value: [1, 0.5, 0.7, 0.3, 0]
- value: 0.5
dtype: bfloat16💻 Usage
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "nagayama0706/music_generation_model"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])