facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
20.17k stars 2.01k forks source link

How to use the API with gradio #424

Open clemtttt opened 4 months ago

clemtttt commented 4 months ago

Hi, Im running musicgen with Gradio but I can't use the API to generate a song from a texte.

I use this code but I always have errors regarding the wrong data used

`from gradio_client import Client import os

client = Client("http://13.43.27.33:7862/") result = client.predict( "Piano ballad", # text description None, fn_index=0, )

print(result) `

Can you help me to find to good code to use the API with gradio ? Thanks in advance