Spaces:
Running
Running
Zekun Wu
commited on
Commit
•
7b1eae1
1
Parent(s):
719373a
update
Browse files- pages/1_Injection.py +6 -4
pages/1_Injection.py
CHANGED
@@ -73,15 +73,17 @@ else:
|
|
73 |
file_options = st.radio("Choose file source:", ["Upload", "Example"])
|
74 |
if file_options == "Example":
|
75 |
#df = pd.read_csv("prompt_test.csv")
|
76 |
-
|
77 |
-
df = df_raw[df_raw['Occupation'] == st.session_state.occupation]
|
78 |
else:
|
79 |
st.session_state.uploaded_file = st.file_uploader("Choose a file")
|
80 |
if st.session_state.uploaded_file is not None:
|
81 |
data = StringIO(st.session_state.uploaded_file.getvalue().decode("utf-8"))
|
82 |
df = pd.read_csv(data)
|
83 |
if df is not None:
|
84 |
-
|
|
|
|
|
|
|
85 |
|
86 |
# Button to add a new row
|
87 |
|
@@ -107,7 +109,7 @@ else:
|
|
107 |
# Process data and display results
|
108 |
with st.spinner('Processing data...'):
|
109 |
parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
|
110 |
-
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.additional_charateristics)
|
111 |
st.session_state.data_processed = True # Mark as processed
|
112 |
|
113 |
st.write('Processed Data:', preprocessed_df)
|
|
|
73 |
file_options = st.radio("Choose file source:", ["Upload", "Example"])
|
74 |
if file_options == "Example":
|
75 |
#df = pd.read_csv("prompt_test.csv")
|
76 |
+
df = pd.read_csv("resume.csv")
|
|
|
77 |
else:
|
78 |
st.session_state.uploaded_file = st.file_uploader("Choose a file")
|
79 |
if st.session_state.uploaded_file is not None:
|
80 |
data = StringIO(st.session_state.uploaded_file.getvalue().decode("utf-8"))
|
81 |
df = pd.read_csv(data)
|
82 |
if df is not None:
|
83 |
+
if file_options == "Example":
|
84 |
+
st.write('Data:',df[df["Occupation"] == st.session_state.occupation])
|
85 |
+
else:
|
86 |
+
st.write('Data:', df)
|
87 |
|
88 |
# Button to add a new row
|
89 |
|
|
|
109 |
# Process data and display results
|
110 |
with st.spinner('Processing data...'):
|
111 |
parameters = {"temperature": st.session_state.temperature, "max_tokens": st.session_state.max_tokens}
|
112 |
+
preprocessed_df = process_scores_multiple(df[df["Occupation"] == st.session_state.occupation], 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.additional_charateristics)
|
113 |
st.session_state.data_processed = True # Mark as processed
|
114 |
|
115 |
st.write('Processed Data:', preprocessed_df)
|