Spaces:
Sleeping
Sleeping
Commit
·
508302b
1
Parent(s):
8d7851f
applying validation for the submit button
Browse files
app.py
CHANGED
@@ -11,6 +11,9 @@ from huggingface_hub import login
|
|
11 |
|
12 |
st.title('classify resume')
|
13 |
st.session_state.uploaded_files=st.file_uploader('upload resume:',accept_multiple_files=True,type=['pdf','.docx'])
|
|
|
|
|
|
|
14 |
|
15 |
# -- method declaration
|
16 |
|
@@ -66,7 +69,7 @@ def find_job_profile():
|
|
66 |
uploaded_file=st.session_state.filename_list[_index]
|
67 |
data_grid_list.append({
|
68 |
'filename':uploaded_file,
|
69 |
-
'job role':predicted_job_role01
|
70 |
})
|
71 |
st.session_state.dgl=data_grid_list
|
72 |
|
@@ -83,10 +86,11 @@ if 'tokenizer' and 'model' not in st.session_state:
|
|
83 |
|
84 |
with st.form('classify_resume'):
|
85 |
process_uploaded_file()
|
86 |
-
submitted=st.form_submit_button('
|
87 |
|
88 |
|
89 |
if submitted:
|
|
|
90 |
st.markdown(
|
91 |
"""
|
92 |
<style>
|
@@ -94,22 +98,18 @@ if submitted:
|
|
94 |
width: 70%; /* Set percentage width */
|
95 |
margin: 0 auto; /* Center align */
|
96 |
}
|
|
|
|
|
|
|
97 |
</style>
|
98 |
""",
|
99 |
unsafe_allow_html=True
|
100 |
)
|
101 |
st.markdown('<div class="dataframe-container">', unsafe_allow_html=True)
|
102 |
-
st.
|
103 |
st.markdown('</div>', unsafe_allow_html=True)
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
# uploaded_resumes=process_uploaded_file(uploaded_files)
|
113 |
-
|
114 |
-
|
115 |
|
|
|
11 |
|
12 |
st.title('classify resume')
|
13 |
st.session_state.uploaded_files=st.file_uploader('upload resume:',accept_multiple_files=True,type=['pdf','.docx'])
|
14 |
+
st.session_state.resume_list=[]
|
15 |
+
st.session_state.filename_list=[]
|
16 |
+
|
17 |
|
18 |
# -- method declaration
|
19 |
|
|
|
69 |
uploaded_file=st.session_state.filename_list[_index]
|
70 |
data_grid_list.append({
|
71 |
'filename':uploaded_file,
|
72 |
+
'job role':predicted_job_role01[0]
|
73 |
})
|
74 |
st.session_state.dgl=data_grid_list
|
75 |
|
|
|
86 |
|
87 |
with st.form('classify_resume'):
|
88 |
process_uploaded_file()
|
89 |
+
submitted=st.form_submit_button('validate uploaded resume',on_click=find_job_profile, disabled=len(st.session_state.resume_list)<=0)
|
90 |
|
91 |
|
92 |
if submitted:
|
93 |
+
df=pd.DataFrame(st.session_state.dgl)
|
94 |
st.markdown(
|
95 |
"""
|
96 |
<style>
|
|
|
98 |
width: 70%; /* Set percentage width */
|
99 |
margin: 0 auto; /* Center align */
|
100 |
}
|
101 |
+
table {
|
102 |
+
width: 100%;
|
103 |
+
}
|
104 |
</style>
|
105 |
""",
|
106 |
unsafe_allow_html=True
|
107 |
)
|
108 |
st.markdown('<div class="dataframe-container">', unsafe_allow_html=True)
|
109 |
+
st.markdown(df.to_html(index=False),unsafe_allow_html=True)
|
110 |
st.markdown('</div>', unsafe_allow_html=True)
|
111 |
|
112 |
|
113 |
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|