Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def fake(message, history):
|
4 |
+
if message.strip():
|
5 |
+
return {
|
6 |
+
"role": "assistant",
|
7 |
+
"content": {
|
8 |
+
"path": "https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav"
|
9 |
+
}
|
10 |
+
}
|
11 |
+
else:
|
12 |
+
return "Please provide the name of an artist"
|
13 |
+
|
14 |
+
gr.ChatInterface(
|
15 |
+
fake,
|
16 |
+
type="messages",
|
17 |
+
textbox=gr.Textbox(placeholder="Which artist's music do you want to listen to?", scale=7),
|
18 |
+
chatbot=gr.Chatbot(placeholder="Play music by any artist!"),
|
19 |
+
).launch()
|