JeCabrera commited on
Commit
ea2ea09
·
verified ·
1 Parent(s): 3ef9bc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -15
app.py CHANGED
@@ -1,19 +1,14 @@
1
  import gradio as gr
2
  import gemini_gradio
3
- import time
4
 
5
- def echo(message, history, system_prompt, tokens):
6
- response = f"System prompt: {system_prompt}\n Message: {message}."
7
- for i in range(min(len(response), int(tokens))):
8
- time.sleep(0.05)
9
- yield response[: i + 1]
10
 
11
- demo = gr.ChatInterface(
12
- echo,
13
- additional_inputs=[
14
- gr.Textbox("You are helpful AI.", label="System Prompt"),
15
- gr.Slider(10, 100),
16
- ],
17
- )
18
-
19
- demo.launch()
 
1
  import gradio as gr
2
  import gemini_gradio
 
3
 
4
+ def fake(message, history):
5
+ if message.strip():
6
+ return gr.Audio("https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav")
7
+ else:
8
+ return "Please provide the name of an artist"
9
 
10
+ gr.ChatInterface(
11
+ fake,
12
+ textbox=gr.Textbox(placeholder="Which artist's music do you want to listen to?", scale=7),
13
+ chatbot=gr.Chatbot(placeholder="Play music by any artist!"),
14
+ ).launch()