AnaviJoshi commited on
Commit
f888f21
·
verified ·
1 Parent(s): 474ccd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -10
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(value="scooby.png", height=600, width = 2048, show_label=False, show_share_button = False, show_download_button = False, container=False)
 
 
 
 
 
 
 
 
 
100
  gr.Markdown(welcome_message)
 
101
  with gr.Row():
102
  with gr.Column():
103
  gr.Markdown(topics)
 
104
  with gr.Tabs():
105
- with gr.Tabletem("Main Page"):
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
- submit_btn.click(fn=respond, inputs=text_input, outputs=output)
112
- with gr.Tabletem("🍲 Recipes"):
113
- 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")
114
-
115
-
116
-
117
- submit_btn.click(fn=respond, inputs=text_input, outputs=output)
118
- #inputs=[text_input, image_input can be added once error fixed
 
 
 
 
 
 
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