Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -286,22 +286,45 @@ with gr.Blocks() as interface:
|
|
| 286 |
|
| 287 |
with gr.Group(visible=True, elem_id="nps-overlay") as nps_modal:
|
| 288 |
#with gr.Column(elem_id="nps-box"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
with gr.Group(elem_id="nps-container"):
|
| 290 |
gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
|
| 291 |
-
# # Use gr.Radio to create clickable buttons
|
| 292 |
-
with gr.Column(elem_id="nps-radio-container"):
|
| 293 |
-
nps_radio = gr.Radio(
|
| 294 |
-
choices=[str(i) for i in range(11)],
|
| 295 |
-
label="Select score:",
|
| 296 |
-
interactive=True,
|
| 297 |
-
container=False
|
| 298 |
-
)
|
| 299 |
|
| 300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
with gr.Row(elem_id="nps-labels-row"):
|
| 302 |
gr.Markdown("Not likely")
|
| 303 |
gr.Markdown("Extremely likely")
|
| 304 |
-
|
| 305 |
nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
|
| 306 |
nps_output = gr.Textbox(label="", interactive=False, visible=True)
|
| 307 |
gr.Markdown(" ") # A simple blank markdown can create space
|
|
@@ -1175,8 +1198,8 @@ with gr.Blocks() as interface:
|
|
| 1175 |
# " text-overflow: clip;" # disable ellipsis
|
| 1176 |
# )
|
| 1177 |
|
| 1178 |
-
if header in ["Sample ID", "Predicted Country", "Predicted Sample Type", "Time cost"]:
|
| 1179 |
-
|
| 1180 |
|
| 1181 |
# if header == "Sources" and isinstance(col, str) and col.strip().lower().startswith("http"):
|
| 1182 |
# col = f"<a href='{col}' target='_blank' style='color: #4ea1f3; text-decoration: underline;'>{col}</a>"
|
|
|
|
| 286 |
|
| 287 |
with gr.Group(visible=True, elem_id="nps-overlay") as nps_modal:
|
| 288 |
#with gr.Column(elem_id="nps-box"):
|
| 289 |
+
# with gr.Group(elem_id="nps-container"):
|
| 290 |
+
# gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
|
| 291 |
+
# # # Use gr.Radio to create clickable buttons
|
| 292 |
+
# with gr.Column(elem_id="nps-radio-container"):
|
| 293 |
+
# nps_radio = gr.Radio(
|
| 294 |
+
# choices=[str(i) for i in range(11)],
|
| 295 |
+
# label="Select score:",
|
| 296 |
+
# interactive=True,
|
| 297 |
+
# container=False
|
| 298 |
+
# )
|
| 299 |
+
|
| 300 |
+
# # The "Not likely" and "Extremely likely" labels
|
| 301 |
+
# with gr.Row(elem_id="nps-labels-row"):
|
| 302 |
+
# gr.Markdown("Not likely")
|
| 303 |
+
# gr.Markdown("Extremely likely")
|
| 304 |
+
|
| 305 |
+
# nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
|
| 306 |
+
css = """
|
| 307 |
+
#nps-labels-row {
|
| 308 |
+
display: flex;
|
| 309 |
+
justify-content: space-between;
|
| 310 |
+
}
|
| 311 |
+
"""
|
| 312 |
with gr.Group(elem_id="nps-container"):
|
| 313 |
gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
|
| 315 |
+
nps_radio = gr.Radio(
|
| 316 |
+
choices=[str(i) for i in range(11)],
|
| 317 |
+
label="Select score:",
|
| 318 |
+
interactive=True,
|
| 319 |
+
container=False,
|
| 320 |
+
elem_id="nps-radio-container" # Assigning elem_id for better styling if needed
|
| 321 |
+
)
|
| 322 |
+
|
| 323 |
+
# Use the elem_id that the CSS is targeting
|
| 324 |
with gr.Row(elem_id="nps-labels-row"):
|
| 325 |
gr.Markdown("Not likely")
|
| 326 |
gr.Markdown("Extremely likely")
|
| 327 |
+
|
| 328 |
nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
|
| 329 |
nps_output = gr.Textbox(label="", interactive=False, visible=True)
|
| 330 |
gr.Markdown(" ") # A simple blank markdown can create space
|
|
|
|
| 1198 |
# " text-overflow: clip;" # disable ellipsis
|
| 1199 |
# )
|
| 1200 |
|
| 1201 |
+
# if header in ["Sample ID", "Predicted Country", "Predicted Sample Type", "Time cost"]:
|
| 1202 |
+
# style += " white-space: nowrap; text-overflow: ellipsis; max-width: 200px; overflow: hidden;"
|
| 1203 |
|
| 1204 |
# if header == "Sources" and isinstance(col, str) and col.strip().lower().startswith("http"):
|
| 1205 |
# col = f"<a href='{col}' target='_blank' style='color: #4ea1f3; text-decoration: underline;'>{col}</a>"
|