Spaces:
Running
Running
Zekun Wu
commited on
Commit
·
4069a9c
1
Parent(s):
d45bfeb
update
Browse files- pages/1_Injection.py +14 -14
pages/1_Injection.py
CHANGED
@@ -60,27 +60,27 @@ 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 |
-
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 |
|
|
|
60 |
|
61 |
# Ensure experiment settings are only shown if model info is submitted
|
62 |
if st.session_state.model_submitted:
|
63 |
+
|
64 |
+
categories = ["HR", "DESIGNER", "INFORMATION-TECHNOLOGY", "TEACHER", "ADVOCATE", "BUSINESS-DEVELOPMENT",
|
65 |
+
"HEALTHCARE", "FITNESS", "AGRICULTURE", "BPO", "SALES", "CONSULTANT", "DIGITAL-MEDIA",
|
66 |
+
"AUTOMOBILE", "CHEF", "FINANCE", "APPAREL", "ENGINEERING", "ACCOUNTANT", "CONSTRUCTION",
|
67 |
+
"PUBLIC-RELATIONS", "BANKING", "ARTS", "AVIATION"]
|
68 |
+
|
69 |
+
st.session_state.occupation = st.selectbox("Occupation", options=categories, index=categories.index(
|
70 |
+
st.session_state.occupation) if st.session_state.occupation in categories else 0)
|
71 |
+
|
72 |
+
df = None
|
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 |
+
df = df[df['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 |
st.write('Data:', df)
|
86 |
|