Spaces:
Build error
Build error
Update app.py
Browse files
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=""
|
| 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 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 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)
|