Spaces:
Running
Running
Zekun Wu
commited on
Commit
•
9bb3d98
1
Parent(s):
db6a6b2
update
Browse files- util/injection.py +0 -4
util/injection.py
CHANGED
@@ -81,16 +81,13 @@ def process_scores_multiple(df, num_run, parameters, privilege_label, protect_la
|
|
81 |
|
82 |
|
83 |
for key, label in zip(['Privilege', 'Protect', 'Neutral'], [privilege_label, protect_label, False]):
|
84 |
-
#prompt_charateristics = create_summary(group_name, label, occupation,'\n'.join(summary) + '\n' + charateristics)
|
85 |
|
86 |
|
87 |
prompt_normal = create_summary(group_name, label, occupation,row)
|
88 |
|
89 |
print(f"Run {run + 1} - Entry {index + 1} - {key}")
|
90 |
print("=============================================================")
|
91 |
-
#result_charateristics = invoke_retry(prompt_charateristics, agent, parameters)
|
92 |
result_normal = invoke_retry(prompt_normal, agent, parameters)
|
93 |
-
#scores[key+"_characteristics"][index].append(result_charateristics)
|
94 |
scores[key][index].append(result_normal)
|
95 |
|
96 |
print(f"Scores: {scores}")
|
@@ -98,7 +95,6 @@ def process_scores_multiple(df, num_run, parameters, privilege_label, protect_la
|
|
98 |
# Ensure all scores are lists and calculate average scores
|
99 |
for category in ['Privilege', 'Protect','Neutral']:
|
100 |
|
101 |
-
|
102 |
# Ensure the scores are lists and check before assignment
|
103 |
series_data = [lst if isinstance(lst, list) else [lst] for lst in scores[category]]
|
104 |
df[f'{category}_Scores'] = series_data
|
|
|
81 |
|
82 |
|
83 |
for key, label in zip(['Privilege', 'Protect', 'Neutral'], [privilege_label, protect_label, False]):
|
|
|
84 |
|
85 |
|
86 |
prompt_normal = create_summary(group_name, label, occupation,row)
|
87 |
|
88 |
print(f"Run {run + 1} - Entry {index + 1} - {key}")
|
89 |
print("=============================================================")
|
|
|
90 |
result_normal = invoke_retry(prompt_normal, agent, parameters)
|
|
|
91 |
scores[key][index].append(result_normal)
|
92 |
|
93 |
print(f"Scores: {scores}")
|
|
|
95 |
# Ensure all scores are lists and calculate average scores
|
96 |
for category in ['Privilege', 'Protect','Neutral']:
|
97 |
|
|
|
98 |
# Ensure the scores are lists and check before assignment
|
99 |
series_data = [lst if isinstance(lst, list) else [lst] for lst in scores[category]]
|
100 |
df[f'{category}_Scores'] = series_data
|