Zekun Wu commited on
Commit
5c97cb4
1 Parent(s): 657095c
pages/2_Injection_Multiple.py CHANGED
@@ -1,7 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  from io import StringIO
4
- from util.generation import process_scores
5
  from util.model import AzureAgent, GPTAgent
6
 
7
  # Set up the Streamlit interface
@@ -74,7 +74,7 @@ if st.session_state.model_submitted:
74
  # Process data and display results
75
  with st.spinner('Processing data...'):
76
  parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
77
- df = process_scores(df, st.session_state.num_run, parameters, [st.session_state.privilege_label,st.session_state.protect_label], agent, st.session_state.group_name,st.session_state.occupation, test_type='multiple')
78
  st.session_state.data_processed = True # Mark as processed
79
 
80
  st.write('Processed Data:', df)
 
1
  import streamlit as st
2
  import pandas as pd
3
  from io import StringIO
4
+ from util.generation import process_scores_multiple
5
  from util.model import AzureAgent, GPTAgent
6
 
7
  # Set up the Streamlit interface
 
74
  # Process data and display results
75
  with st.spinner('Processing data...'):
76
  parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
77
+ df = process_scores_multiple(df, st.session_state.num_run, parameters, st.session_state.privilege_label,st.session_state.protect_label, agent, st.session_state.group_name,st.session_state.occupation)
78
  st.session_state.data_processed = True # Mark as processed
79
 
80
  st.write('Processed Data:', df)
pages/4_Injection_Single.py CHANGED
@@ -1,7 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  from io import StringIO
4
- from util.generation import process_scores
5
  from util.model import AzureAgent, GPTAgent
6
 
7
  # Set up the Streamlit interface
@@ -73,9 +73,9 @@ if st.session_state.model_submitted:
73
  # Process data and display results
74
  with st.spinner('Processing data...'):
75
  parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
76
- df = process_scores(df, st.session_state.num_run, parameters, [st.session_state.counterfactual_label],
77
  agent, st.session_state.group_name,
78
- st.session_state.occupation,test_type='multiple')
79
  st.session_state.data_processed = True # Mark as processed
80
 
81
  st.write('Processed Data:', df)
 
1
  import streamlit as st
2
  import pandas as pd
3
  from io import StringIO
4
+ from util.generation import process_scores_single
5
  from util.model import AzureAgent, GPTAgent
6
 
7
  # Set up the Streamlit interface
 
73
  # Process data and display results
74
  with st.spinner('Processing data...'):
75
  parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
76
+ df = process_scores_single(df, st.session_state.num_run, parameters, st.session_state.counterfactual_label,
77
  agent, st.session_state.group_name,
78
+ st.session_state.occupation)
79
  st.session_state.data_processed = True # Mark as processed
80
 
81
  st.write('Processed Data:', df)