Peiran commited on
Commit
bf7288d
·
1 Parent(s): 579bdeb

Fix indentation inside Blocks: move event bindings and controls under gr.Blocks context; py_compile passes

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.py +99 -99
__pycache__/app.cpython-311.pyc CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
 
app.py CHANGED
@@ -535,108 +535,108 @@ with gr.Blocks(title="VisArena Human Evaluation") as demo:
535
  b_semantic_input = gr.Slider(1, 5, value=3, step=1, label="B: Semantic/Functional Alignment")
536
  b_overall_input = gr.Slider(1, 5, value=3, step=1, label="B: Overall Photorealism")
537
 
538
- submit_button = gr.Button("Submit Evaluation", variant="primary")
539
- feedback_box = gr.Markdown("")
540
-
541
- # Event bindings
542
- task_selector.change(
543
- fn=on_task_change,
544
- inputs=[task_selector, pair_state],
545
- outputs=[
546
- pair_state,
547
- index_slider,
548
- pair_header,
549
- orig_image,
550
- model1_image,
551
- model2_image,
552
- a_physical_input,
553
- a_optical_input,
554
- a_semantic_input,
555
- a_overall_input,
556
- b_physical_input,
557
- b_optical_input,
558
- b_semantic_input,
559
- b_overall_input,
560
- feedback_box,
561
- ],
562
- )
563
 
564
- index_slider.release(
565
- fn=on_pair_navigate,
566
- inputs=[index_slider, pair_state],
567
- outputs=[
568
- index_slider,
569
- pair_header,
570
- orig_image,
571
- model1_image,
572
- model2_image,
573
- a_physical_input,
574
- a_optical_input,
575
- a_semantic_input,
576
- a_overall_input,
577
- b_physical_input,
578
- b_optical_input,
579
- b_semantic_input,
580
- b_overall_input,
581
- ],
582
- )
583
 
584
- submit_button.click(
585
- fn=on_submit,
586
- inputs=[
587
- task_selector,
588
- index_slider,
589
- pair_state,
590
- a_physical_input,
591
- a_optical_input,
592
- a_semantic_input,
593
- a_overall_input,
594
- b_physical_input,
595
- b_optical_input,
596
- b_semantic_input,
597
- b_overall_input,
598
- ],
599
- outputs=[
600
- pair_state,
601
- index_slider,
602
- pair_header,
603
- orig_image,
604
- model1_image,
605
- model2_image,
606
- a_physical_input,
607
- a_optical_input,
608
- a_semantic_input,
609
- a_overall_input,
610
- b_physical_input,
611
- b_optical_input,
612
- b_semantic_input,
613
- b_overall_input,
614
- feedback_box,
615
- ],
616
- )
617
 
618
- # Auto-load default task on startup
619
- demo.load(
620
- fn=on_task_change,
621
- inputs=[task_selector, pair_state],
622
- outputs=[
623
- pair_state,
624
- index_slider,
625
- pair_header,
626
- orig_image,
627
- model1_image,
628
- model2_image,
629
- a_physical_input,
630
- a_optical_input,
631
- a_semantic_input,
632
- a_overall_input,
633
- b_physical_input,
634
- b_optical_input,
635
- b_semantic_input,
636
- b_overall_input,
637
- feedback_box,
638
- ],
639
- )
640
 
641
 
642
  if __name__ == "__main__":
 
535
  b_semantic_input = gr.Slider(1, 5, value=3, step=1, label="B: Semantic/Functional Alignment")
536
  b_overall_input = gr.Slider(1, 5, value=3, step=1, label="B: Overall Photorealism")
537
 
538
+ submit_button = gr.Button("Submit Evaluation", variant="primary")
539
+ feedback_box = gr.Markdown("")
540
+
541
+ # Event bindings
542
+ task_selector.change(
543
+ fn=on_task_change,
544
+ inputs=[task_selector, pair_state],
545
+ outputs=[
546
+ pair_state,
547
+ index_slider,
548
+ pair_header,
549
+ orig_image,
550
+ model1_image,
551
+ model2_image,
552
+ a_physical_input,
553
+ a_optical_input,
554
+ a_semantic_input,
555
+ a_overall_input,
556
+ b_physical_input,
557
+ b_optical_input,
558
+ b_semantic_input,
559
+ b_overall_input,
560
+ feedback_box,
561
+ ],
562
+ )
563
 
564
+ index_slider.release(
565
+ fn=on_pair_navigate,
566
+ inputs=[index_slider, pair_state],
567
+ outputs=[
568
+ index_slider,
569
+ pair_header,
570
+ orig_image,
571
+ model1_image,
572
+ model2_image,
573
+ a_physical_input,
574
+ a_optical_input,
575
+ a_semantic_input,
576
+ a_overall_input,
577
+ b_physical_input,
578
+ b_optical_input,
579
+ b_semantic_input,
580
+ b_overall_input,
581
+ ],
582
+ )
583
 
584
+ submit_button.click(
585
+ fn=on_submit,
586
+ inputs=[
587
+ task_selector,
588
+ index_slider,
589
+ pair_state,
590
+ a_physical_input,
591
+ a_optical_input,
592
+ a_semantic_input,
593
+ a_overall_input,
594
+ b_physical_input,
595
+ b_optical_input,
596
+ b_semantic_input,
597
+ b_overall_input,
598
+ ],
599
+ outputs=[
600
+ pair_state,
601
+ index_slider,
602
+ pair_header,
603
+ orig_image,
604
+ model1_image,
605
+ model2_image,
606
+ a_physical_input,
607
+ a_optical_input,
608
+ a_semantic_input,
609
+ a_overall_input,
610
+ b_physical_input,
611
+ b_optical_input,
612
+ b_semantic_input,
613
+ b_overall_input,
614
+ feedback_box,
615
+ ],
616
+ )
617
 
618
+ # Auto-load default task on startup
619
+ demo.load(
620
+ fn=on_task_change,
621
+ inputs=[task_selector, pair_state],
622
+ outputs=[
623
+ pair_state,
624
+ index_slider,
625
+ pair_header,
626
+ orig_image,
627
+ model1_image,
628
+ model2_image,
629
+ a_physical_input,
630
+ a_optical_input,
631
+ a_semantic_input,
632
+ a_overall_input,
633
+ b_physical_input,
634
+ b_optical_input,
635
+ b_semantic_input,
636
+ b_overall_input,
637
+ feedback_box,
638
+ ],
639
+ )
640
 
641
 
642
  if __name__ == "__main__":