Spaces:
Sleeping
Sleeping
Update ui/components.py
Browse files- ui/components.py +15 -5
ui/components.py
CHANGED
@@ -146,7 +146,9 @@ def get_custom_css():
|
|
146 |
"""
|
147 |
return css
|
148 |
|
149 |
-
def create_header_section():
|
|
|
|
|
150 |
return gr.HTML("""
|
151 |
<div class="header-section">
|
152 |
<h1 style="margin: 0; font-size: 2.5em; font-weight: 700;">
|
@@ -161,7 +163,9 @@ def create_header_section():
|
|
161 |
</div>
|
162 |
""")
|
163 |
|
164 |
-
def create_query_input_section():
|
|
|
|
|
165 |
with gr.Group(elem_classes=["query-container"]):
|
166 |
gr.Markdown("### 🩺 Medical Query Input")
|
167 |
query_input = gr.Textbox(
|
@@ -184,7 +188,9 @@ def create_query_input_section():
|
|
184 |
)
|
185 |
return query_input, submit_btn, clear_btn
|
186 |
|
187 |
-
def create_response_output_section():
|
|
|
|
|
188 |
with gr.Group(elem_classes=["response-container"]):
|
189 |
gr.Markdown("### 🩹 Medical Guidance Response")
|
190 |
response_output = gr.Textbox(label="AI Medical Guidance", lines=15, interactive=False, placeholder="Your medical guidance will appear here...")
|
@@ -207,7 +213,9 @@ def create_response_output_section():
|
|
207 |
)
|
208 |
return response_output, metadata_output, status_output
|
209 |
|
210 |
-
def create_quick_access_section():
|
|
|
|
|
211 |
return gr.Markdown("""
|
212 |
### ⚡ Optimized Features
|
213 |
|
@@ -230,7 +238,9 @@ def create_quick_access_section():
|
|
230 |
- Professional disclaimers
|
231 |
""")
|
232 |
|
233 |
-
def create_example_scenarios(query_input):
|
|
|
|
|
234 |
example_queries = [
|
235 |
"How to treat severe burns when clean water is extremely limited?",
|
236 |
"Managing gunshot wounds with only basic household supplies",
|
|
|
146 |
"""
|
147 |
return css
|
148 |
|
149 |
+
def create_header_section(language="English"):
|
150 |
+
from core.utils.translations import translations
|
151 |
+
t = translations.get(language, translations["English"])
|
152 |
return gr.HTML("""
|
153 |
<div class="header-section">
|
154 |
<h1 style="margin: 0; font-size: 2.5em; font-weight: 700;">
|
|
|
163 |
</div>
|
164 |
""")
|
165 |
|
166 |
+
def create_query_input_section(language="English"):
|
167 |
+
from core.utils.translations import translations
|
168 |
+
t = translations.get(language, translations["English"])
|
169 |
with gr.Group(elem_classes=["query-container"]):
|
170 |
gr.Markdown("### 🩺 Medical Query Input")
|
171 |
query_input = gr.Textbox(
|
|
|
188 |
)
|
189 |
return query_input, submit_btn, clear_btn
|
190 |
|
191 |
+
def create_response_output_section(language="English"):
|
192 |
+
from core.utils.translations import translations
|
193 |
+
t = translations.get(language, translations["English"])
|
194 |
with gr.Group(elem_classes=["response-container"]):
|
195 |
gr.Markdown("### 🩹 Medical Guidance Response")
|
196 |
response_output = gr.Textbox(label="AI Medical Guidance", lines=15, interactive=False, placeholder="Your medical guidance will appear here...")
|
|
|
213 |
)
|
214 |
return response_output, metadata_output, status_output
|
215 |
|
216 |
+
def create_quick_access_section(language="English"):
|
217 |
+
from core.utils.translations import translations
|
218 |
+
t = translations.get(language, translations["English"])
|
219 |
return gr.Markdown("""
|
220 |
### ⚡ Optimized Features
|
221 |
|
|
|
238 |
- Professional disclaimers
|
239 |
""")
|
240 |
|
241 |
+
def create_example_scenarios(query_input, language="English"):
|
242 |
+
from core.utils.translations import translations
|
243 |
+
t = translations.get(language, translations["English"])
|
244 |
example_queries = [
|
245 |
"How to treat severe burns when clean water is extremely limited?",
|
246 |
"Managing gunshot wounds with only basic household supplies",
|