Spaces:
Configuration error
Configuration error
Commit
Β·
fb60fa8
1
Parent(s):
da25614
Cleaned up Gradio output.
Browse files- resumate.py +17 -24
resumate.py
CHANGED
|
@@ -16,10 +16,10 @@ To run:
|
|
| 16 |
|
| 17 |
import gradio as gr
|
| 18 |
from functions.linkedin_resume import extract_text_from_linkedin_pdf
|
| 19 |
-
from functions.github import get_github_repositories
|
| 20 |
|
| 21 |
|
| 22 |
-
def process_inputs(linkedin_pdf, github_url,
|
| 23 |
"""
|
| 24 |
Process the input files and URLs.
|
| 25 |
|
|
@@ -35,54 +35,45 @@ def process_inputs(linkedin_pdf, github_url, job_post_url):
|
|
| 35 |
|
| 36 |
# Process LinkedIn PDF file
|
| 37 |
if linkedin_pdf is not None:
|
| 38 |
-
result +=
|
| 39 |
|
| 40 |
# Extract and structure text from the PDF
|
| 41 |
extraction_result = extract_text_from_linkedin_pdf(linkedin_pdf.name)
|
| 42 |
|
| 43 |
if extraction_result["status"] == "success":
|
| 44 |
-
|
| 45 |
-
result += "β
Text extraction successful\n"
|
| 46 |
-
result += structured_text["llm_formatted"] + "\n"
|
| 47 |
|
| 48 |
elif extraction_result["status"] == "warning":
|
| 49 |
-
result += f"β οΈ Text extraction: {extraction_result['message']}\n\n"
|
| 50 |
else:
|
| 51 |
-
result += f"β Text extraction failed: {extraction_result['message']}\n\n"
|
| 52 |
else:
|
| 53 |
result += "β No LinkedIn resume PDF file uploaded\n\n"
|
| 54 |
|
| 55 |
# Process GitHub profile
|
| 56 |
if github_url and github_url.strip():
|
| 57 |
-
result +=
|
| 58 |
|
| 59 |
# Retrieve repositories from GitHub
|
| 60 |
github_result = get_github_repositories(github_url)
|
| 61 |
|
| 62 |
if github_result["status"] == "success":
|
| 63 |
-
|
| 64 |
-
repositories = github_result["repositories"]
|
| 65 |
-
|
| 66 |
-
result += f" π GitHub extraction: SUCCESS\n"
|
| 67 |
-
result += f" π€ Username: {metadata['username']}\n"
|
| 68 |
-
result += f" π Public repositories found: {len(repositories)}\n\n"
|
| 69 |
-
|
| 70 |
-
# Show the formatted repositories for LLM
|
| 71 |
-
result += "π GITHUB REPOSITORIES (LLM-Ready):\n"
|
| 72 |
-
result += "=" * 60 + "\n"
|
| 73 |
-
result += format_repositories_for_llm(github_result) + "\n"
|
| 74 |
-
result += "=" * 60 + "\n\n"
|
| 75 |
|
| 76 |
else:
|
| 77 |
-
result += f"
|
| 78 |
else:
|
| 79 |
result += "β No GitHub profile URL provided\n\n"
|
| 80 |
|
| 81 |
# Process other inputs
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
return result
|
| 85 |
|
|
|
|
| 86 |
with gr.Blocks() as demo:
|
| 87 |
gr.Markdown("# Resumate: tailored resume generator")
|
| 88 |
|
|
@@ -111,7 +102,9 @@ with gr.Blocks() as demo:
|
|
| 111 |
gr.Markdown("""
|
| 112 |
## 2. Project portfolio
|
| 113 |
|
| 114 |
-
Provide your GitHub profile URL, resumate will select and add the projects most
|
|
|
|
|
|
|
| 115 |
""")
|
| 116 |
|
| 117 |
github_profile = gr.Textbox(
|
|
|
|
| 16 |
|
| 17 |
import gradio as gr
|
| 18 |
from functions.linkedin_resume import extract_text_from_linkedin_pdf
|
| 19 |
+
from functions.github import get_github_repositories
|
| 20 |
|
| 21 |
|
| 22 |
+
def process_inputs(linkedin_pdf, github_url, job_post_text):
|
| 23 |
"""
|
| 24 |
Process the input files and URLs.
|
| 25 |
|
|
|
|
| 35 |
|
| 36 |
# Process LinkedIn PDF file
|
| 37 |
if linkedin_pdf is not None:
|
| 38 |
+
result += "β
LinkedIn Resume PDF uploaded\n"
|
| 39 |
|
| 40 |
# Extract and structure text from the PDF
|
| 41 |
extraction_result = extract_text_from_linkedin_pdf(linkedin_pdf.name)
|
| 42 |
|
| 43 |
if extraction_result["status"] == "success":
|
| 44 |
+
result += " β
Text extraction successful\n\n"
|
|
|
|
|
|
|
| 45 |
|
| 46 |
elif extraction_result["status"] == "warning":
|
| 47 |
+
result += f" β οΈ Text extraction: {extraction_result['message']}\n\n"
|
| 48 |
else:
|
| 49 |
+
result += f" β Text extraction failed: {extraction_result['message']}\n\n"
|
| 50 |
else:
|
| 51 |
result += "β No LinkedIn resume PDF file uploaded\n\n"
|
| 52 |
|
| 53 |
# Process GitHub profile
|
| 54 |
if github_url and github_url.strip():
|
| 55 |
+
result += "β
GitHub Profile URL provided\n"
|
| 56 |
|
| 57 |
# Retrieve repositories from GitHub
|
| 58 |
github_result = get_github_repositories(github_url)
|
| 59 |
|
| 60 |
if github_result["status"] == "success":
|
| 61 |
+
result += " β
GitHub list download successful\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
else:
|
| 64 |
+
result += f" β GitHub extraction failed: {github_result['message']}\n\n"
|
| 65 |
else:
|
| 66 |
result += "β No GitHub profile URL provided\n\n"
|
| 67 |
|
| 68 |
# Process other inputs
|
| 69 |
+
if job_post_text:
|
| 70 |
+
result += "β
Job post text provided\n"
|
| 71 |
+
else:
|
| 72 |
+
result += f"β Job post not provided\n"
|
| 73 |
|
| 74 |
return result
|
| 75 |
|
| 76 |
+
|
| 77 |
with gr.Blocks() as demo:
|
| 78 |
gr.Markdown("# Resumate: tailored resume generator")
|
| 79 |
|
|
|
|
| 102 |
gr.Markdown("""
|
| 103 |
## 2. Project portfolio
|
| 104 |
|
| 105 |
+
Provide your GitHub profile URL, resumate will select and add the projects most relevant to the job post. Only public repositories will be considered.
|
| 106 |
+
|
| 107 |
+
**Tip**: Make sure your GitHub profile is complete and up-to-date before using resumate!
|
| 108 |
""")
|
| 109 |
|
| 110 |
github_profile = gr.Textbox(
|