Spaces:
Running
Running
Resolved merge conflict in app.py
Browse files- .gitattributes +35 -0
- README.md +12 -0
- app.py +18 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: ResumeParser
|
3 |
+
emoji: 🔥
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: blue
|
6 |
+
sdk: streamlit
|
7 |
+
sdk_version: 1.29.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
+
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -10,7 +10,10 @@ from resume_template import Resume
|
|
10 |
from json import JSONDecodeError
|
11 |
import PyPDF2
|
12 |
import json
|
|
|
13 |
import time
|
|
|
|
|
14 |
|
15 |
load_dotenv()
|
16 |
|
@@ -84,10 +87,17 @@ st.title("Resume Parser")
|
|
84 |
|
85 |
# Set up the LLM dictionary
|
86 |
llm_dict = {
|
|
|
87 |
# "gpt-4-1106-preview": ChatOpenAI(temperature=0, model="gpt-4-1106-preview"),
|
88 |
# "gpt-4": ChatOpenAI(temperature=0, model="gpt-4"),
|
89 |
"gpt-3.5-turbo-1106": ChatOpenAI(temperature=0, model="gpt-3.5-turbo-1106"),
|
90 |
# "claude-2": ChatAnthropic(model="claude-2", max_tokens=20_000),
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
"claude-instant-1": ChatAnthropic(model="claude-instant-1", max_tokens=20_000)
|
92 |
}
|
93 |
|
@@ -101,14 +111,18 @@ uploaded_file = st.file_uploader("Upload a PDF file", type="pdf")
|
|
101 |
if uploaded_file is not None:
|
102 |
# Add a button to trigger the conversion
|
103 |
if st.button("Convert PDF to Text"):
|
|
|
104 |
start_time = time.time() # Start the timer
|
105 |
|
|
|
|
|
106 |
# Convert the uploaded file to a string
|
107 |
text = pdf_to_string(uploaded_file)
|
108 |
|
109 |
# Extract resume fields using the selected model
|
110 |
extracted_fields = extract_resume_fields(text, selected_model)
|
111 |
|
|
|
112 |
end_time = time.time() # Stop the timer
|
113 |
elapsed_time = end_time - start_time # Calculate the elapsed time
|
114 |
|
@@ -125,3 +139,7 @@ if uploaded_file is not None:
|
|
125 |
for key, value in extracted_fields.items():
|
126 |
st.write(f"{key}: {value}")
|
127 |
|
|
|
|
|
|
|
|
|
|
10 |
from json import JSONDecodeError
|
11 |
import PyPDF2
|
12 |
import json
|
13 |
+
<<<<<<< HEAD
|
14 |
import time
|
15 |
+
=======
|
16 |
+
>>>>>>> 726975d5ca7f0a98a5047fbda8870a0f03f55283
|
17 |
|
18 |
load_dotenv()
|
19 |
|
|
|
87 |
|
88 |
# Set up the LLM dictionary
|
89 |
llm_dict = {
|
90 |
+
<<<<<<< HEAD
|
91 |
# "gpt-4-1106-preview": ChatOpenAI(temperature=0, model="gpt-4-1106-preview"),
|
92 |
# "gpt-4": ChatOpenAI(temperature=0, model="gpt-4"),
|
93 |
"gpt-3.5-turbo-1106": ChatOpenAI(temperature=0, model="gpt-3.5-turbo-1106"),
|
94 |
# "claude-2": ChatAnthropic(model="claude-2", max_tokens=20_000),
|
95 |
+
=======
|
96 |
+
"gpt-4-1106-preview": ChatOpenAI(temperature=0, model="gpt-4-1106-preview"),
|
97 |
+
"gpt-4": ChatOpenAI(temperature=0, model="gpt-4"),
|
98 |
+
"gpt-3.5-turbo-1106": ChatOpenAI(temperature=0, model="gpt-3.5-turbo-1106"),
|
99 |
+
"claude-2": ChatAnthropic(model="claude-2", max_tokens=20_000),
|
100 |
+
>>>>>>> 726975d5ca7f0a98a5047fbda8870a0f03f55283
|
101 |
"claude-instant-1": ChatAnthropic(model="claude-instant-1", max_tokens=20_000)
|
102 |
}
|
103 |
|
|
|
111 |
if uploaded_file is not None:
|
112 |
# Add a button to trigger the conversion
|
113 |
if st.button("Convert PDF to Text"):
|
114 |
+
<<<<<<< HEAD
|
115 |
start_time = time.time() # Start the timer
|
116 |
|
117 |
+
=======
|
118 |
+
>>>>>>> 726975d5ca7f0a98a5047fbda8870a0f03f55283
|
119 |
# Convert the uploaded file to a string
|
120 |
text = pdf_to_string(uploaded_file)
|
121 |
|
122 |
# Extract resume fields using the selected model
|
123 |
extracted_fields = extract_resume_fields(text, selected_model)
|
124 |
|
125 |
+
<<<<<<< HEAD
|
126 |
end_time = time.time() # Stop the timer
|
127 |
elapsed_time = end_time - start_time # Calculate the elapsed time
|
128 |
|
|
|
139 |
for key, value in extracted_fields.items():
|
140 |
st.write(f"{key}: {value}")
|
141 |
|
142 |
+
=======
|
143 |
+
# Display the extracted fields on the Streamlit app
|
144 |
+
st.json(extracted_fields)
|
145 |
+
>>>>>>> 726975d5ca7f0a98a5047fbda8870a0f03f55283
|