gonzalolinares commited on
Commit
193395b
·
1 Parent(s): b3a3abf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,7 +1,15 @@
1
- import gradio as gr
2
 
3
- def greet(prompt):
4
- return "Hello " + prompt + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
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)