gperdrizet commited on
Commit
fb60fa8
Β·
1 Parent(s): da25614

Cleaned up Gradio output.

Browse files
Files changed (1) hide show
  1. 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, format_repositories_for_llm
20
 
21
 
22
- def process_inputs(linkedin_pdf, github_url, job_post_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 += f"βœ… LinkedIn Resume PDF uploaded: {linkedin_pdf.name}\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
- structured_text = extraction_result["structured_text"]
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 += f"βœ… GitHub Profile URL provided: {github_url}\n"
58
 
59
  # Retrieve repositories from GitHub
60
  github_result = get_github_repositories(github_url)
61
 
62
  if github_result["status"] == "success":
63
- metadata = github_result["metadata"]
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" ❌ GitHub extraction failed: {github_result['message']}\n\n"
78
  else:
79
  result += "❌ No GitHub profile URL provided\n\n"
80
 
81
  # Process other inputs
82
- result += f"Job Post: {job_post_url if job_post_url else 'Not provided'}\n"
 
 
 
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 relevent to the job post.
 
 
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(