Spaces:
Running on Zero
Running on Zero
apingali commited on
Commit ·
67bc0e3
1
Parent(s): 49b7f70
Fix empty textboxes on initial load in analytics tab
Browse files
app.py
CHANGED
|
@@ -488,21 +488,29 @@ with gr.Blocks(title="The Plain-English Translator") as demo:
|
|
| 488 |
label="Select Example to Compare"
|
| 489 |
)
|
| 490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
with gr.Row():
|
| 492 |
with gr.Column():
|
| 493 |
gr.Markdown("**Claude Opus 4.5 (Benchmark)**")
|
| 494 |
-
claude_output = gr.Textbox(lines=5, interactive=False, show_label=False)
|
| 495 |
with gr.Column():
|
| 496 |
gr.Markdown("**Gemma-2-2B**")
|
| 497 |
-
gemma_output = gr.Textbox(lines=5, interactive=False, show_label=False)
|
| 498 |
|
| 499 |
with gr.Row():
|
| 500 |
with gr.Column():
|
| 501 |
gr.Markdown("**TinyLlama-1.1B**")
|
| 502 |
-
tinyllama_output = gr.Textbox(lines=5, interactive=False, show_label=False)
|
| 503 |
with gr.Column():
|
| 504 |
gr.Markdown("**Qwen2-0.5B**")
|
| 505 |
-
qwen_output = gr.Textbox(lines=5, interactive=False, show_label=False)
|
| 506 |
|
| 507 |
def update_example_outputs(selection):
|
| 508 |
# Parse selection to get domain and concept
|
|
|
|
| 488 |
label="Select Example to Compare"
|
| 489 |
)
|
| 490 |
|
| 491 |
+
# Get initial values for the first example
|
| 492 |
+
first_domain = "Legal"
|
| 493 |
+
first_concept = list(BENCHMARK_DATA["claude_opus_benchmarks"]["Legal"].keys())[0]
|
| 494 |
+
initial_claude = BENCHMARK_DATA["claude_opus_benchmarks"][first_domain][first_concept]["translation"]
|
| 495 |
+
initial_gemma = BENCHMARK_DATA["model_results"]["Gemma-2-2B"]["results"][first_domain][first_concept].get("output", "") or "(SMC pruned all paths)"
|
| 496 |
+
initial_tiny = BENCHMARK_DATA["model_results"]["TinyLlama-1.1B"]["results"][first_domain][first_concept].get("output", "") or "(SMC pruned all paths)"
|
| 497 |
+
initial_qwen = BENCHMARK_DATA["model_results"]["Qwen2-0.5B"]["results"][first_domain][first_concept].get("output", "") or "(SMC pruned all paths)"
|
| 498 |
+
|
| 499 |
with gr.Row():
|
| 500 |
with gr.Column():
|
| 501 |
gr.Markdown("**Claude Opus 4.5 (Benchmark)**")
|
| 502 |
+
claude_output = gr.Textbox(value=initial_claude, lines=5, interactive=False, show_label=False)
|
| 503 |
with gr.Column():
|
| 504 |
gr.Markdown("**Gemma-2-2B**")
|
| 505 |
+
gemma_output = gr.Textbox(value=initial_gemma, lines=5, interactive=False, show_label=False)
|
| 506 |
|
| 507 |
with gr.Row():
|
| 508 |
with gr.Column():
|
| 509 |
gr.Markdown("**TinyLlama-1.1B**")
|
| 510 |
+
tinyllama_output = gr.Textbox(value=initial_tiny, lines=5, interactive=False, show_label=False)
|
| 511 |
with gr.Column():
|
| 512 |
gr.Markdown("**Qwen2-0.5B**")
|
| 513 |
+
qwen_output = gr.Textbox(value=initial_qwen, lines=5, interactive=False, show_label=False)
|
| 514 |
|
| 515 |
def update_example_outputs(selection):
|
| 516 |
# Parse selection to get domain and concept
|