Spaces:
Runtime error
Runtime error
Commit
·
5603c80
1
Parent(s):
9c00ff7
Align axis labels with theory and scenario hints
Browse files
app.py
CHANGED
|
@@ -424,6 +424,33 @@ DEFAULT_PROMPTS = {
|
|
| 424 |
"Free form": "Brainstorm creative uses of brain-steered language models in five bullet points."
|
| 425 |
}
|
| 426 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
with gr.Blocks(
|
| 428 |
title="Cognitive Proxy",
|
| 429 |
theme=gr.themes.Base(
|
|
@@ -508,34 +535,52 @@ with gr.Blocks(
|
|
| 508 |
|
| 509 |
with gr.Row():
|
| 510 |
with gr.Column():
|
| 511 |
-
|
|
|
|
| 512 |
output_semantic = gr.Textbox(
|
| 513 |
label="",
|
| 514 |
lines=10,
|
| 515 |
interactive=False,
|
| 516 |
container=False
|
| 517 |
)
|
| 518 |
-
gr.Markdown("
|
| 519 |
|
| 520 |
with gr.Column():
|
| 521 |
-
gr.HTML('<div class="value-label">
|
| 522 |
output_baseline = gr.Textbox(
|
| 523 |
label="",
|
| 524 |
lines=10,
|
| 525 |
interactive=False,
|
| 526 |
container=False
|
| 527 |
)
|
| 528 |
-
gr.Markdown("
|
| 529 |
|
| 530 |
with gr.Column():
|
| 531 |
-
gr.HTML('<div class="value-label">
|
| 532 |
output_syntactic = gr.Textbox(
|
| 533 |
label="",
|
| 534 |
lines=10,
|
| 535 |
interactive=False,
|
| 536 |
container=False
|
| 537 |
)
|
| 538 |
-
gr.Markdown("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
|
| 540 |
generate_btn.click(
|
| 541 |
generate_variants,
|
|
|
|
| 424 |
"Free form": "Brainstorm creative uses of brain-steered language models in five bullet points."
|
| 425 |
}
|
| 426 |
|
| 427 |
+
SCENARIO_AXIS_TEXT = {
|
| 428 |
+
"Technical writing": {
|
| 429 |
+
"left_label": "Semantic / Content (meaning-heavy, concrete) [empathetic/actionable tone]",
|
| 430 |
+
"baseline_label": "Baseline",
|
| 431 |
+
"right_label": "Syntactic / Function (structure-heavy, abstract) [formal/policy tone]",
|
| 432 |
+
"left_caption": "*Steered toward meaning (brain semantic side)*",
|
| 433 |
+
"baseline_caption": "*No brain steering*",
|
| 434 |
+
"right_caption": "*Steered toward structure (brain syntactic side)*",
|
| 435 |
+
},
|
| 436 |
+
"Educational": {
|
| 437 |
+
"left_label": "Semantic / Content (meaning-heavy, concrete) [analogy/concrete style]",
|
| 438 |
+
"baseline_label": "Baseline",
|
| 439 |
+
"right_label": "Syntactic / Function (structure-heavy, abstract) [definition/logical style]",
|
| 440 |
+
"left_caption": "*Steered toward meaning (brain semantic side)*",
|
| 441 |
+
"baseline_caption": "*No brain steering*",
|
| 442 |
+
"right_caption": "*Steered toward structure (brain syntactic side)*",
|
| 443 |
+
},
|
| 444 |
+
"Free form": {
|
| 445 |
+
"left_label": "Semantic / Content (meaning-heavy, concrete)",
|
| 446 |
+
"baseline_label": "Baseline",
|
| 447 |
+
"right_label": "Syntactic / Function (structure-heavy, abstract)",
|
| 448 |
+
"left_caption": "*Steered toward meaning (brain semantic side)*",
|
| 449 |
+
"baseline_caption": "*No brain steering*",
|
| 450 |
+
"right_caption": "*Steered toward structure (brain syntactic side)*",
|
| 451 |
+
},
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
with gr.Blocks(
|
| 455 |
title="Cognitive Proxy",
|
| 456 |
theme=gr.themes.Base(
|
|
|
|
| 535 |
|
| 536 |
with gr.Row():
|
| 537 |
with gr.Column():
|
| 538 |
+
axis_text = SCENARIO_AXIS_TEXT["Technical writing"]
|
| 539 |
+
left_label = gr.HTML(f'<div class="value-label">{axis_text["left_label"]}</div>')
|
| 540 |
output_semantic = gr.Textbox(
|
| 541 |
label="",
|
| 542 |
lines=10,
|
| 543 |
interactive=False,
|
| 544 |
container=False
|
| 545 |
)
|
| 546 |
+
left_caption = gr.Markdown(axis_text["left_caption"], elem_classes=["caption"])
|
| 547 |
|
| 548 |
with gr.Column():
|
| 549 |
+
baseline_label = gr.HTML(f'<div class="value-label">{axis_text["baseline_label"]}</div>')
|
| 550 |
output_baseline = gr.Textbox(
|
| 551 |
label="",
|
| 552 |
lines=10,
|
| 553 |
interactive=False,
|
| 554 |
container=False
|
| 555 |
)
|
| 556 |
+
baseline_caption = gr.Markdown(axis_text["baseline_caption"], elem_classes=["caption"])
|
| 557 |
|
| 558 |
with gr.Column():
|
| 559 |
+
right_label = gr.HTML(f'<div class="value-label">{axis_text["right_label"]}</div>')
|
| 560 |
output_syntactic = gr.Textbox(
|
| 561 |
label="",
|
| 562 |
lines=10,
|
| 563 |
interactive=False,
|
| 564 |
container=False
|
| 565 |
)
|
| 566 |
+
right_caption = gr.Markdown(axis_text["right_caption"], elem_classes=["caption"])
|
| 567 |
+
|
| 568 |
+
def update_axis_labels(selected):
|
| 569 |
+
data = SCENARIO_AXIS_TEXT.get(selected, SCENARIO_AXIS_TEXT["Free form"])
|
| 570 |
+
return (
|
| 571 |
+
data["left_label"],
|
| 572 |
+
data["baseline_label"],
|
| 573 |
+
data["right_label"],
|
| 574 |
+
data["left_caption"],
|
| 575 |
+
data["baseline_caption"],
|
| 576 |
+
data["right_caption"],
|
| 577 |
+
)
|
| 578 |
+
|
| 579 |
+
scenario.change(
|
| 580 |
+
update_axis_labels,
|
| 581 |
+
inputs=[scenario],
|
| 582 |
+
outputs=[left_label, baseline_label, right_label, left_caption, baseline_caption, right_caption],
|
| 583 |
+
)
|
| 584 |
|
| 585 |
generate_btn.click(
|
| 586 |
generate_variants,
|