Spaces:
Sleeping
Sleeping
Update app.py
Browse files94 unmodified lines95969798991009910110210310410510610710810911011111211311411511611710511811912012112212311111211311411511611711812412512612712812913013113213313413513613713813914094 unmodified lines #chatbot = gr.ChatInterface(respond, type = "messages", theme)
import gradio as gr
with gr.Blocks(theme=theme) as demo: gr.Image(value="scooby.png", height=600, width = 2048, show_label=False, show_share_button = False, show_download_button = False, container=False) gr.Image( value="scooby.png", height=600, width=2048, show_label=False, show_share_button=False, show_download_button=False, container=False ) gr.Markdown(welcome_message) with gr.Row(): with gr.Column(): gr.Markdown(topics) with gr.Tabs(): with gr.Tabletem("Main Page"): with gr.Tab("Main Page"): with gr.Row(): text_input = gr.Textbox(label="Ask Scooby a question about your pet") # image_input = gr.Image(type="pil", label="Upload an image of your pet (optional)") output = gr.Textbox(label="Scooby's Answer") submit_btn = gr.Button("Ask Scooby") submit_btn.click(fn=respond, inputs=text_input, outputs=output) with gr.Tabletem("๐ฒ Recipes"): gr.ChatInterface(fn=respond_recipe,title="Pet Recipe Assistant ๐ฝ๏ธ",textbox=gr.Textbox(placeholder="What does your pet need a recipe for?", label="Recipe Request"),chat_history=True,retry_btn="๐ Try Again",clear_btn="๐งน Clear Chat")
submit_btn.click(fn=respond, inputs=text_input, outputs=output) #inputs=[text_input, image_input can be added once error fixed submit_btn.click(fn=respond, inputs=text_input, outputs=output)
with gr.Tab("๐ฒ Recipes"): gr.ChatInterface( fn=respond_recipe, title="Pet Recipe Assistant ๐ฝ๏ธ", textbox=gr.Textbox( placeholder="What does your pet need a recipe for?", label="Recipe Request" ), chat_history=True, retry_btn="๐ Try Again", clear_btn="๐งน Clear Chat" )
app.py+29-10