Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -95,27 +95,46 @@ topics = """
|
|
| 95 |
|
| 96 |
#chatbot = gr.ChatInterface(respond, type = "messages", theme)
|
| 97 |
|
|
|
|
|
|
|
| 98 |
with gr.Blocks(theme=theme) as demo:
|
| 99 |
-
gr.Image(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
gr.Markdown(welcome_message)
|
|
|
|
| 101 |
with gr.Row():
|
| 102 |
with gr.Column():
|
| 103 |
gr.Markdown(topics)
|
|
|
|
| 104 |
with gr.Tabs():
|
| 105 |
-
with gr.
|
| 106 |
with gr.Row():
|
| 107 |
text_input = gr.Textbox(label="Ask Scooby a question about your pet")
|
| 108 |
# image_input = gr.Image(type="pil", label="Upload an image of your pet (optional)")
|
| 109 |
output = gr.Textbox(label="Scooby's Answer")
|
| 110 |
submit_btn = gr.Button("Ask Scooby")
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
|
| 121 |
|
|
|
|
| 95 |
|
| 96 |
#chatbot = gr.ChatInterface(respond, type = "messages", theme)
|
| 97 |
|
| 98 |
+
import gradio as gr
|
| 99 |
+
|
| 100 |
with gr.Blocks(theme=theme) as demo:
|
| 101 |
+
gr.Image(
|
| 102 |
+
value="scooby.png",
|
| 103 |
+
height=600,
|
| 104 |
+
width=2048,
|
| 105 |
+
show_label=False,
|
| 106 |
+
show_share_button=False,
|
| 107 |
+
show_download_button=False,
|
| 108 |
+
container=False
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
gr.Markdown(welcome_message)
|
| 112 |
+
|
| 113 |
with gr.Row():
|
| 114 |
with gr.Column():
|
| 115 |
gr.Markdown(topics)
|
| 116 |
+
|
| 117 |
with gr.Tabs():
|
| 118 |
+
with gr.Tab("Main Page"):
|
| 119 |
with gr.Row():
|
| 120 |
text_input = gr.Textbox(label="Ask Scooby a question about your pet")
|
| 121 |
# image_input = gr.Image(type="pil", label="Upload an image of your pet (optional)")
|
| 122 |
output = gr.Textbox(label="Scooby's Answer")
|
| 123 |
submit_btn = gr.Button("Ask Scooby")
|
| 124 |
+
submit_btn.click(fn=respond, inputs=text_input, outputs=output)
|
| 125 |
+
|
| 126 |
+
with gr.Tab("🍲 Recipes"):
|
| 127 |
+
gr.ChatInterface(
|
| 128 |
+
fn=respond_recipe,
|
| 129 |
+
title="Pet Recipe Assistant 🍽️",
|
| 130 |
+
textbox=gr.Textbox(
|
| 131 |
+
placeholder="What does your pet need a recipe for?",
|
| 132 |
+
label="Recipe Request"
|
| 133 |
+
),
|
| 134 |
+
chat_history=True,
|
| 135 |
+
retry_btn="🔁 Try Again",
|
| 136 |
+
clear_btn="🧹 Clear Chat"
|
| 137 |
+
)
|
| 138 |
|
| 139 |
|
| 140 |
|