Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	fixed UI
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -162,17 +162,19 @@ def handle_vote_submission(example, m_a, m_b, winner, feedback, summary_a, summa 
     | 
|
| 162 | 
         
             
                return submit_vote_with_elo(m_a, m_b, winner, feedback, current_results)
         
     | 
| 163 | 
         | 
| 164 | 
         
             
            def show_loading_state():
         
     | 
| 
         | 
|
| 165 | 
         
             
                return [
         
     | 
| 166 | 
         
             
                    gr.update(value="Loading new question and summaries...", interactive=False),
         
     | 
| 167 | 
         
             
                    gr.update(value="Loading new question and summaries...", interactive=False),
         
     | 
| 168 | 
         
            -
                    gr.update(interactive=False),
         
     | 
| 169 | 
         
            -
                    gr.update(interactive=False),
         
     | 
| 170 | 
         
            -
                    gr.update(interactive=False),
         
     | 
| 171 | 
         
            -
                    gr.update(interactive=False),
         
     | 
| 172 | 
         
            -
                    gr.update(visible=False),
         
     | 
| 173 | 
         
            -
                    gr.update(interactive=False),
         
     | 
| 174 | 
         
            -
                    gr.update(visible=False),
         
     | 
| 175 | 
         
            -
                    gr.update(interactive=False)
         
     | 
| 
         | 
|
| 176 | 
         
             
                ]
         
     | 
| 177 | 
         | 
| 178 | 
         
             
            def handle_new_example_click():
         
     | 
| 
         @@ -367,7 +369,8 @@ The Elo rating system provides a more accurate ranking than simple win rates: 
     | 
|
| 367 | 
         
             
                        outputs=[
         
     | 
| 368 | 
         
             
                            summary_a_display, summary_b_display, 
         
     | 
| 369 | 
         
             
                            vote_button_a, vote_button_b, vote_button_tie, vote_button_neither,
         
     | 
| 370 | 
         
            -
                            feedback_section, submit_button, results_reveal_area, random_question_btn
         
     | 
| 
         | 
|
| 371 | 
         
             
                        ]
         
     | 
| 372 | 
         
             
                    ).then(
         
     | 
| 373 | 
         
             
                        fn=handle_new_example_click,
         
     | 
| 
         | 
|
| 162 | 
         
             
                return submit_vote_with_elo(m_a, m_b, winner, feedback, current_results)
         
     | 
| 163 | 
         | 
| 164 | 
         
             
            def show_loading_state():
         
     | 
| 165 | 
         
            +
                """Show loading state while fetching new content and reset UI elements"""
         
     | 
| 166 | 
         
             
                return [
         
     | 
| 167 | 
         
             
                    gr.update(value="Loading new question and summaries...", interactive=False),
         
     | 
| 168 | 
         
             
                    gr.update(value="Loading new question and summaries...", interactive=False),
         
     | 
| 169 | 
         
            +
                    gr.update(interactive=False, elem_classes=["vote-button"]),  # Reset styling
         
     | 
| 170 | 
         
            +
                    gr.update(interactive=False, elem_classes=["vote-button"]),
         
     | 
| 171 | 
         
            +
                    gr.update(interactive=False, elem_classes=["vote-button"]),
         
     | 
| 172 | 
         
            +
                    gr.update(interactive=False, elem_classes=["vote-button", "vote-button-neither"]),
         
     | 
| 173 | 
         
            +
                    gr.update(visible=False),      # feedback_section
         
     | 
| 174 | 
         
            +
                    gr.update(interactive=False),  # submit_button
         
     | 
| 175 | 
         
            +
                    gr.update(visible=False),      # results_reveal_area
         
     | 
| 176 | 
         
            +
                    gr.update(interactive=False),  # random_question_btn
         
     | 
| 177 | 
         
            +
                    None  # Reset selected_winner
         
     | 
| 178 | 
         
             
                ]
         
     | 
| 179 | 
         | 
| 180 | 
         
             
            def handle_new_example_click():
         
     | 
| 
         | 
|
| 369 | 
         
             
                        outputs=[
         
     | 
| 370 | 
         
             
                            summary_a_display, summary_b_display, 
         
     | 
| 371 | 
         
             
                            vote_button_a, vote_button_b, vote_button_tie, vote_button_neither,
         
     | 
| 372 | 
         
            +
                            feedback_section, submit_button, results_reveal_area, random_question_btn,
         
     | 
| 373 | 
         
            +
                            selected_winner  # Add selected_winner to reset vote state
         
     | 
| 374 | 
         
             
                        ]
         
     | 
| 375 | 
         
             
                    ).then(
         
     | 
| 376 | 
         
             
                        fn=handle_new_example_click,
         
     |