music generation model

Providernagayama0706
Categoryaudio-generation
Licenseapache-2.0
Downloads8
Stars0

Overview

This audio generation model provides a flexible toolset for developers looking to integrate programmatic music synthesis into their applications. Built on an Apache-2.0 license, it offers the openness required for commercial scaling without restrictive licensing hurdles. The model is designed to handle diverse musical styles and structures, making it suitable for dynamic background audio in games, AI-driven content creation tools, or personalized soundscapes. Unlike rigid sample-based libraries, this model allows for generative variance, enabling developers to create unique audio assets via API calls. Integration is straightforward for those familiar with standard audio-generation pipelines, focusing on low-latency output and high fidelity.

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
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# 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:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

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)

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

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 Download
git lfs install
git clone https://huggingface.co/nagayama0706/music_generation_model

To skip LFS large-file downloads, use:

Skip LFS
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

Install Transformers
pip install -U transformers torch

Load the model and run inference

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

来源: HuggingFace

---
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

yaml
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

python
!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"])

Join our Telegram