Spaces:
Running
Running
Zekun Wu
commited on
Commit
•
f97d08f
1
Parent(s):
c3903ae
update
Browse files- pages/1_Injection.py +1 -1
- util/injection.py +1 -1
pages/1_Injection.py
CHANGED
@@ -106,7 +106,7 @@ else:
|
|
106 |
# Process data and display results
|
107 |
with st.spinner('Processing data...'):
|
108 |
parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
|
109 |
-
preprocessed_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)
|
110 |
st.session_state.data_processed = True # Mark as processed
|
111 |
|
112 |
st.write('Processed Data:', preprocessed_df)
|
|
|
106 |
# Process data and display results
|
107 |
with st.spinner('Processing data...'):
|
108 |
parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
|
109 |
+
preprocessed_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,st.session_state.charateristics)
|
110 |
st.session_state.data_processed = True # Mark as processed
|
111 |
|
112 |
st.write('Processed Data:', preprocessed_df)
|
util/injection.py
CHANGED
@@ -69,7 +69,7 @@ def calculate_avg_score(score_list):
|
|
69 |
avg_score = sum(valid_scores) / len(valid_scores)
|
70 |
return avg_score
|
71 |
return None
|
72 |
-
def process_scores_multiple(df, num_run, parameters, privilege_label, protect_label, agent, group_name, occupation,charateristics
|
73 |
|
74 |
print(f"Processing {len(df)} entries with {num_run} runs each.")
|
75 |
""" Process entries and compute scores concurrently, with progress updates. """
|
|
|
69 |
avg_score = sum(valid_scores) / len(valid_scores)
|
70 |
return avg_score
|
71 |
return None
|
72 |
+
def process_scores_multiple(df, num_run, parameters, privilege_label, protect_label, agent, group_name, occupation,charateristics):
|
73 |
|
74 |
print(f"Processing {len(df)} entries with {num_run} runs each.")
|
75 |
""" Process entries and compute scores concurrently, with progress updates. """
|