def update_responses(dataset, checkpoint_a, checkpoint_b, index):
    """Update displayed responses based on selections"""
    responses_a = load_responses(checkpoint_a, dataset)
    responses_b = load_responses(checkpoint_b, dataset)
    
    if not responses_a or not responses_b:
        return [gr.update()]*6 + [gr.Slider(maximum=0)]  # Updated number of returns
    
    index = min(index, len(responses_a)-1, len(responses_b)-1)
    example_a = responses_a[index]
    example_b = responses_b[index]
    
    diff_html = generate_diff(example_a["pred"], example_b["pred"])
    
    # Create info strings for both responses
    info_a = f"Stop Reason: {example_a['stop_reason']} | Correctness: {example_a['score']}"
    info_b = f"Stop Reason: {example_b['stop_reason']} | Correctness: {example_b['score']}"
    
    return [
        example_a["input"],
        example_a["pred"],
        example_b["pred"],
        info_a,
        info_b,
        diff_html,
        gr.Slider(maximum=len(responses_a)-1)
    ]
Update displayed responses based on selections
examples/simplelr_math_eval/visualizer.py