Spaces:
Runtime error
Runtime error
gonzalolinares
commited on
Commit
·
193395b
1
Parent(s):
b3a3abf
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
-
import
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
|
3 |
+
API_URL = "https://api-inference.huggingface.co/models/facebook/musicgen-large"
|
4 |
+
headers = {"Authorization": "Bearer APITOKEN"}
|
5 |
|
6 |
+
def query(payload):
|
7 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
8 |
+
return response.content
|
9 |
+
|
10 |
+
audio_bytes = query({
|
11 |
+
"inputs": "liquid drum",
|
12 |
+
})
|
13 |
+
# You can access the audio with IPython.display for example
|
14 |
+
from IPython.display import Audio
|
15 |
+
Audio(audio_bytes)
|