victoriaono commited on
Commit
6ef1973
·
verified ·
1 Parent(s): 4491624

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -30
app.py CHANGED
@@ -1,34 +1,13 @@
1
  import gradio as gr
2
 
3
- def yes_man(message, history):
4
- if message.endswith("?"):
5
- return "Yes"
6
  else:
7
- return "##Testing\n\n**bold**\n\n- List item"
8
 
9
- # gr.ChatInterface(
10
- # yes_man,
11
- # chatbot=gr.Chatbot(height=300),
12
- # textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
13
- # title="Yes Man",
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()