arjunanand13 commited on
Commit
abb5430
·
verified ·
1 Parent(s): a9e4071

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -20
app.py CHANGED
@@ -139,6 +139,12 @@ with gr.Blocks() as demo:
139
  label="Status",
140
  interactive=False
141
  )
 
 
 
 
 
 
142
 
143
  with gr.Column(scale=2):
144
  gr.Markdown("### Microcontroller Selection Interface")
@@ -146,7 +152,7 @@ with gr.Blocks() as demo:
146
  label="Briefly describe your target application for controller recommendation",
147
  placeholder="Example: Industrial motor control system with precise temperature monitoring...",
148
  lines=3,
149
- value="" # This will keep the input persistent
150
  )
151
  explanation_text = gr.Textbox(
152
  label="Explanation",
@@ -162,25 +168,18 @@ with gr.Blocks() as demo:
162
  submit_button = gr.Button("Send")
163
  clear_history_button = gr.Button("Clear Chat History")
164
 
165
- pdf_path = "renesas-ra6m1-group-datasheet.pdf"
166
-
167
- with gr.Group():
168
- gr.Markdown("### Example Applications")
169
- gr.Examples(
170
- [
171
- ["Industrial automation system requiring precise motion control and multiple sensor inputs"],
172
- ["Battery-powered IoT device with wireless connectivity and low power requirements"],
173
- ["High-performance motor control application with real-time processing needs"],
174
- ["Smart building management system with multiple environmental sensors"]
175
- ],
176
- inputs=[question_input],
177
- label="Example Applications"
178
- )
179
- gr.Examples(
180
- [[pdf_path]],
181
- inputs=[pdf_input],
182
- label="Example PDF"
183
- )
184
 
185
  def handle_question(question):
186
  explanation, df = pdf_chat.answer_question(question)
 
139
  label="Status",
140
  interactive=False
141
  )
142
+ # PDF example right under PDF controls
143
+ gr.Examples(
144
+ [[os.path.join(os.path.dirname(__file__), "renesas-ra6m1-group-datasheet.pdf")]],
145
+ inputs=[pdf_input],
146
+ label="Example PDF"
147
+ )
148
 
149
  with gr.Column(scale=2):
150
  gr.Markdown("### Microcontroller Selection Interface")
 
152
  label="Briefly describe your target application for controller recommendation",
153
  placeholder="Example: Industrial motor control system with precise temperature monitoring...",
154
  lines=3,
155
+ value=""
156
  )
157
  explanation_text = gr.Textbox(
158
  label="Explanation",
 
168
  submit_button = gr.Button("Send")
169
  clear_history_button = gr.Button("Clear Chat History")
170
 
171
+ # Example applications section
172
+ gr.Markdown("### Example Applications")
173
+ gr.Examples(
174
+ [
175
+ "Industrial automation system requiring precise motion control and multiple sensor inputs",
176
+ "Battery-powered IoT device with wireless connectivity and low power requirements",
177
+ "High-performance motor control application with real-time processing needs",
178
+ "Smart building management system with multiple environmental sensors"
179
+ ],
180
+ inputs=question_input,
181
+ label="Example Queries"
182
+ )
 
 
 
 
 
 
 
183
 
184
  def handle_question(question):
185
  explanation, df = pdf_chat.answer_question(question)