Instructions to use pbotsaris/musicgen-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pbotsaris/musicgen-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="pbotsaris/musicgen-small")# Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("pbotsaris/musicgen-small") model = AutoModelForTextToWaveform.from_pretrained("pbotsaris/musicgen-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| from handler import EndpointHandler | |
| # init handler | |
| print('init handler') | |
| my_handler = EndpointHandler(path=".") | |
| p = {"inputs": "I am quite excited how this will turn out", "duration": 2} | |
| print('calling handler') | |
| pred=my_handler(p) | |
| print("done") | |
| print(pred) | |