Instructions to use BinaryLight1011/Musicbeat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BinaryLight1011/Musicbeat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="BinaryLight1011/Musicbeat")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BinaryLight1011/Musicbeat", device_map="auto") - PEFT
How to use BinaryLight1011/Musicbeat with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| base_model: facebook/musicgen-small | |
| library_name: transformers | |
| pipeline_tag: text-to-audio | |
| tags: | |
| - lora | |
| - musicgen | |
| - music-generation | |
| - peft | |
| # MusicGen LoRA Fine-Tuned | |
| LoRA adapter fine-tuned on custom music dataset using `facebook/musicgen-small`. | |
| ## Como usar | |
| ```python | |
| from transformers import AutoProcessor, MusicgenForConditionalGeneration | |
| from peft import PeftModel | |
| import torch, soundfile as sf | |
| processor = AutoProcessor.from_pretrained("facebook/musicgen-small") | |
| model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small") | |
| model.decoder = PeftModel.from_pretrained(model.decoder, "SEU_REPO_AQUI") | |
| inputs = processor(text=["upbeat electronic music"], return_tensors="pt") | |
| audio = model.generate(**inputs, max_new_tokens=256) | |
| sf.write("output.wav", audio[0].cpu().numpy(), 32000) | |
| ``` | |