Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -157,10 +157,10 @@ def convert_to_json(llm, cv_text):
|
|
| 157 |
def pdf_to_text(prompt, maxtokens=2048, temperature=0, top_probability=0.95):
|
| 158 |
#def pdf_to_text(cv_file, job_description, maxtokens=2048, temperature=0, top_probability=0.95):
|
| 159 |
|
| 160 |
-
page2content = process_document(cv_file)
|
| 161 |
-
cv_text = ""
|
| 162 |
-
for page_id in page2content:
|
| 163 |
-
|
| 164 |
converter = DocumentConverter()
|
| 165 |
result = converter.convert(cv_file)
|
| 166 |
cv_text = result.document.export_to_markdown()
|
|
@@ -174,6 +174,7 @@ def pdf_to_text(prompt, maxtokens=2048, temperature=0, top_probability=0.95):
|
|
| 174 |
)
|
| 175 |
cv_text, crafted_cv = craft_cv(llm, cv_text, job_description, maxtokens, temperature, top_probability)
|
| 176 |
# cv_text, crafted_cv = craft_cv(llm, prompt, maxtokens, temperature, top_probability)
|
|
|
|
| 177 |
return crafted_cv
|
| 178 |
|
| 179 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.9, label="Temperature Value")
|
|
|
|
| 157 |
def pdf_to_text(prompt, maxtokens=2048, temperature=0, top_probability=0.95):
|
| 158 |
#def pdf_to_text(cv_file, job_description, maxtokens=2048, temperature=0, top_probability=0.95):
|
| 159 |
|
| 160 |
+
# page2content = process_document(cv_file)
|
| 161 |
+
# cv_text = ""
|
| 162 |
+
# for page_id in page2content:
|
| 163 |
+
# cv_text += page2content[page_id] + ' '
|
| 164 |
converter = DocumentConverter()
|
| 165 |
result = converter.convert(cv_file)
|
| 166 |
cv_text = result.document.export_to_markdown()
|
|
|
|
| 174 |
)
|
| 175 |
cv_text, crafted_cv = craft_cv(llm, cv_text, job_description, maxtokens, temperature, top_probability)
|
| 176 |
# cv_text, crafted_cv = craft_cv(llm, prompt, maxtokens, temperature, top_probability)
|
| 177 |
+
crafted_cv = convert_to_json(crafted_cv)
|
| 178 |
return crafted_cv
|
| 179 |
|
| 180 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.9, label="Temperature Value")
|