Spaces:
Runtime error
Runtime error
File size: 421 Bytes
193395b 019e095 193395b 019e095 193395b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import requests
API_URL = "https://api-inference.huggingface.co/models/facebook/musicgen-large"
headers = {"Authorization": "Bearer APITOKEN"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.content
audio_bytes = query({
"inputs": "liquid drum",
})
# You can access the audio with IPython.display for example
from IPython.display import Audio
Audio(audio_bytes)
|