victoriaono's picture
Update app.py
4491624 verified
raw
history blame
1.05 kB
import gradio as gr
def yes_man(message, history):
if message.endswith("?"):
return "Yes"
else:
return "##Testing\n\n**bold**\n\n- List item"
# gr.ChatInterface(
# yes_man,
# chatbot=gr.Chatbot(height=300),
# textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
# title="Yes Man",
# description="Ask Yes Man any question",
# theme="soft",
# examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
# cache_examples=True,
# retry_btn=None,
# undo_btn="Delete Previous",
# clear_btn="Clear",
# ).launch()
def load():
return [
("## Here's an audio", gr.Audio("https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav")),
("Here's an video", gr.Video("https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/world.mp4"))
]
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
button = gr.Button("Load audio and video")
button.click(load, None, chatbot)
demo.launch()