Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,13 @@ PREDEFINED_QUESTIONS = [
|
|
26 |
"How do I integrate custom recovery behaviors?"
|
27 |
]
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
def generate_prompt(context: str, question: str, system_prompt: str = DEFAULT_SYSTEM_PROMPT) -> str:
|
30 |
return f"""
|
31 |
[INST] <<SYS>>
|
@@ -128,6 +135,12 @@ with gr.Blocks(title="ROS2 Expert Assistant") as demo:
|
|
128 |
value="Select a question...",
|
129 |
label="Pre-defined Questions"
|
130 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
with gr.Row():
|
133 |
# Chat interface
|
@@ -224,4 +237,4 @@ with gr.Blocks(title="ROS2 Expert Assistant") as demo:
|
|
224 |
)
|
225 |
|
226 |
if __name__ == "__main__":
|
227 |
-
demo.launch(share
|
|
|
26 |
"How do I integrate custom recovery behaviors?"
|
27 |
]
|
28 |
|
29 |
+
# Helper text for tooltip
|
30 |
+
DROPDOWN_TOOLTIP = """
|
31 |
+
You can either:
|
32 |
+
• Select a predefined question from this dropdown
|
33 |
+
• Type your own question in the text box below
|
34 |
+
"""
|
35 |
+
|
36 |
def generate_prompt(context: str, question: str, system_prompt: str = DEFAULT_SYSTEM_PROMPT) -> str:
|
37 |
return f"""
|
38 |
[INST] <<SYS>>
|
|
|
135 |
value="Select a question...",
|
136 |
label="Pre-defined Questions"
|
137 |
)
|
138 |
+
with gr.Column(scale=1):
|
139 |
+
# Info icon with tooltip
|
140 |
+
gr.Markdown(
|
141 |
+
"""<div title="{}">ℹ️</div>""".format(DROPDOWN_TOOLTIP),
|
142 |
+
elem_classes=["tooltip"]
|
143 |
+
)
|
144 |
|
145 |
with gr.Row():
|
146 |
# Chat interface
|
|
|
237 |
)
|
238 |
|
239 |
if __name__ == "__main__":
|
240 |
+
demo.launch(share)
|