File size: 1,713 Bytes
9366995
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# web/pages/step3.py
import streamlit as st
from pages.step3_left import render_step3_left
from pages.step3_right import render_step3_right

# web/pages/step3.py

def render_step3():
    st.header("Step 3: Select Your Metrics")
    st.markdown("Choose which metrics and models you want to use for evaluation.")

    st.session_state.setdefault("use_openai", True)
    st.session_state.setdefault("use_hf", False)

    col_left, col_right = st.columns([1, 1])
    with col_left:
        selected_metrics = render_step3_left()  # writes st.session_state.selected_metrics
    with col_right:
        render_step3_right()                     # right pane manages refined subset

    use_openai = st.session_state.get("use_openai", True)
    use_hf     = st.session_state.get("use_hf", False)

    col1, col2 = st.columns(2)
    with col1:
        if st.button("← Back", use_container_width=True):
            st.session_state.step = 2
            st.rerun()
    with col2:
        can_go = (
            bool(selected_metrics) and
            st.session_state.get("conversation_uploaded", False) and
            (use_openai or use_hf)
        )
        if st.button("Start Evaluation →", type="primary", use_container_width=True, disabled=not can_go):
            # Snapshot refined subset for Step 4
            from core.workflow import filter_refined_metrics
            refined = st.session_state.get("refined")
            allowed = st.session_state.get("allowed_refined_metric_names", [])
            if refined:
                st.session_state.profile_refined_subset = filter_refined_metrics(refined, allowed)
            # continue to results
            st.session_state.step = 4
            st.rerun()