Downloads · 30 days
18
24% of all-time downloads
bfh-genai/meditation-musicgen
meditation-musicgen is a text-to-audio model from bfh-genai. Use it for the text-to-audio task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
This model is a fine-tuned version of facebooks MusicGen. Refer to https://huggingface.co/facebook/musicgen-small for more details.
Downloads · 30 days
18
24% of all-time downloads
All-time downloads
76
Public
Repo size
11.1 GB
Likes
2
Public
Click a slice to open those files.
.bin2.4 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of facebooks MusicGen. Refer to https://huggingface.co/facebook/musicgen-small for more details.
You can run MeditationMusicGen locally with the 🤗 Transformers library from version 4.31.0 onwards.
pip install --upgrade pip
pip install --upgrade transformers scipy
from transformers import AutoProcessor, MusicgenForConditionalGeneration
import scipy
processor = AutoProcessor.from_pretrained("facebook/musicgen-small")
model = MusicgenForConditionalGeneration.from_pretrained("bfh-genai/meditation-musicgen")
relaxing_description = 'Peaceful meditation background sound'
conditioned_text_input = processor(text=relaxing_description, padding=True, return_tensors="pt")
audio_value = model.generate(**conditioned_text_input,
do_sample=True,
guidance_scale=3, # Value >1, best results achieved with 3.
max_new_tokens=256 # 256 ^= 5 seconds of audio.
)
scipy.io.wavfile.write(f"my_audio.wav", rate=32_000, data=audio_values[0, 0].numpy())
License: Code is released under MIT, model weights are released under CC-BY-NC 4.0.