Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
d45bfeb
1
Parent(s):
c050d3e
update
Browse files- pages/1_Injection.py +15 -13
pages/1_Injection.py
CHANGED
@@ -60,26 +60,28 @@ else:
|
|
60 |
|
61 |
# Ensure experiment settings are only shown if model info is submitted
|
62 |
if st.session_state.model_submitted:
|
63 |
-
|
64 |
file_options = st.radio("Choose file source:", ["Upload", "Example"])
|
65 |
if file_options == "Example":
|
66 |
#df = pd.read_csv("prompt_test.csv")
|
67 |
-
|
68 |
else:
|
69 |
st.session_state.uploaded_file = st.file_uploader("Choose a file")
|
70 |
if st.session_state.uploaded_file is not None:
|
71 |
data = StringIO(st.session_state.uploaded_file.getvalue().decode("utf-8"))
|
72 |
-
|
73 |
-
if
|
74 |
-
|
75 |
-
"HR", "DESIGNER", "INFORMATION-TECHNOLOGY", "TEACHER", "ADVOCATE", "BUSINESS-DEVELOPMENT",
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
83 |
st.write('Data:', df)
|
84 |
|
85 |
# Button to add a new row
|
|
|
60 |
|
61 |
# Ensure experiment settings are only shown if model info is submitted
|
62 |
if st.session_state.model_submitted:
|
63 |
+
df_raw = None
|
64 |
file_options = st.radio("Choose file source:", ["Upload", "Example"])
|
65 |
if file_options == "Example":
|
66 |
#df = pd.read_csv("prompt_test.csv")
|
67 |
+
df_raw = pd.read_csv("resume.csv")
|
68 |
else:
|
69 |
st.session_state.uploaded_file = st.file_uploader("Choose a file")
|
70 |
if st.session_state.uploaded_file is not None:
|
71 |
data = StringIO(st.session_state.uploaded_file.getvalue().decode("utf-8"))
|
72 |
+
df_raw = pd.read_csv(data)
|
73 |
+
if df_raw is not None:
|
74 |
+
if file_options == "Example":
|
75 |
+
categories = ["HR", "DESIGNER", "INFORMATION-TECHNOLOGY", "TEACHER", "ADVOCATE", "BUSINESS-DEVELOPMENT",
|
76 |
+
"HEALTHCARE", "FITNESS", "AGRICULTURE", "BPO", "SALES", "CONSULTANT", "DIGITAL-MEDIA",
|
77 |
+
"AUTOMOBILE", "CHEF", "FINANCE", "APPAREL", "ENGINEERING", "ACCOUNTANT", "CONSTRUCTION",
|
78 |
+
"PUBLIC-RELATIONS", "BANKING", "ARTS", "AVIATION"]
|
79 |
+
|
80 |
+
st.session_state.occupation = st.selectbox("Occupation", options=categories, index=categories.index(st.session_state.occupation) if st.session_state.occupation in categories else 0)
|
81 |
+
df = df_raw[df_raw['Occupation'] == st.session_state.occupation]
|
82 |
+
else:
|
83 |
+
df = df_raw
|
84 |
+
|
85 |
st.write('Data:', df)
|
86 |
|
87 |
# Button to add a new row
|