Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,34 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
-
if message.
|
5 |
-
return "
|
6 |
else:
|
7 |
-
return "
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
# description="Ask Yes Man any question",
|
15 |
-
# theme="soft",
|
16 |
-
# examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
|
17 |
-
# cache_examples=True,
|
18 |
-
# retry_btn=None,
|
19 |
-
# undo_btn="Delete Previous",
|
20 |
-
# clear_btn="Clear",
|
21 |
-
# ).launch()
|
22 |
-
|
23 |
-
def load():
|
24 |
-
return [
|
25 |
-
("## Here's an audio", gr.Audio("https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav")),
|
26 |
-
("Here's an video", gr.Video("https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/world.mp4"))
|
27 |
-
]
|
28 |
-
|
29 |
-
with gr.Blocks() as demo:
|
30 |
-
chatbot = gr.Chatbot()
|
31 |
-
button = gr.Button("Load audio and video")
|
32 |
-
button.click(load, None, chatbot)
|
33 |
-
|
34 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def fake(message, history):
|
4 |
+
if message.strip():
|
5 |
+
return gr.Audio("https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav")
|
6 |
else:
|
7 |
+
return "Please provide the name of an artist"
|
8 |
|
9 |
+
gr.ChatInterface(
|
10 |
+
fake,
|
11 |
+
textbox=gr.Textbox(placeholder="Which artist's music do you want to listen to?", scale=7),
|
12 |
+
chatbot=gr.Chatbot(placeholder="Play music by any artist!"),
|
13 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|