gperdrizet commited on
Commit
6d69b0b
·
verified ·
1 Parent(s): b888581

Updated interface

Browse files
Files changed (2) hide show
  1. functions/gradio.py +4 -52
  2. resumate.py +1 -1
functions/gradio.py CHANGED
@@ -58,7 +58,6 @@ def process_inputs(
58
  logger.info("GitHub username: %s", github_username)
59
  logger.info("Job post: %s", clean_text_whitespace(job_post_text[:100]).replace("\n", " "))
60
  logger.info("User instructions: %s", user_instructions[:100] if user_instructions else "None")
61
- result = ""
62
 
63
  # ==================================================================== #
64
  # Extract and structure text from the linkedin profile PDF
@@ -110,12 +109,14 @@ def process_inputs(
110
  # logger.info("Input processing completed")
111
 
112
  # ==================================================================== #
113
- # Generate resume only if we have valid extraction result
 
 
114
  if linkedin_resume and github_repositories and job_post:
115
  logger.info("Generating resume with provided data")
116
 
117
  try:
118
- _ = write_resume(linkedin_resume, github_repositories, job_post)
119
 
120
  except Exception as e:
121
  logger.error("Resume generation failed: %s", str(e))
@@ -123,52 +124,3 @@ def process_inputs(
123
  logger.warning("Resume generation skipped - content missing")
124
 
125
  return result
126
-
127
-
128
- # def get_processed_data(linkedin_pdf, github_url, job_post_text, instructions):
129
- # """
130
- # Get structured data from all inputs for further processing.
131
-
132
- # Args:
133
- # linkedin_pdf: Uploaded LinkedIn resume export PDF file
134
- # github_url (str): GitHub profile URL
135
- # job_post_text (str): Job post text content
136
- # instructions (str): Additional instructions from the user
137
-
138
- # Returns:
139
- # dict: Structured data containing all processed information
140
- # """
141
-
142
- # job_post_text = job_post_text.strip() if job_post_text and job_post_text.strip() else None
143
- # instructions = instructions.strip() if instructions and instructions.strip() else None
144
-
145
- # processed_data = {
146
- # "linkedin": None,
147
- # "github": None,
148
- # "job_post": job_post_text,
149
- # "user_instructions": instructions,
150
- # "errors": []
151
- # }
152
-
153
- # # Process LinkedIn PDF
154
- # if linkedin_pdf is not None:
155
- # file_path = linkedin_pdf.name
156
- # extraction_result = extract_text_from_linkedin_pdf(file_path)
157
-
158
- # if extraction_result["status"] == "success":
159
- # processed_data["linkedin"] = extraction_result
160
-
161
- # else:
162
- # processed_data["errors"].append(f"LinkedIn: {extraction_result['message']}")
163
-
164
- # # Process GitHub profile
165
- # if github_url and github_url.strip():
166
- # github_result = get_github_repositories(github_url)
167
-
168
- # if github_result["status"] == "success":
169
- # processed_data["github"] = github_result
170
-
171
- # else:
172
- # processed_data["errors"].append(f"GitHub: {github_result['message']}")
173
-
174
- # return processed_data
 
58
  logger.info("GitHub username: %s", github_username)
59
  logger.info("Job post: %s", clean_text_whitespace(job_post_text[:100]).replace("\n", " "))
60
  logger.info("User instructions: %s", user_instructions[:100] if user_instructions else "None")
 
61
 
62
  # ==================================================================== #
63
  # Extract and structure text from the linkedin profile PDF
 
109
  # logger.info("Input processing completed")
110
 
111
  # ==================================================================== #
112
+ # Generate resume only if we have valid extraction results
113
+ result = None
114
+
115
  if linkedin_resume and github_repositories and job_post:
116
  logger.info("Generating resume with provided data")
117
 
118
  try:
119
+ result = write_resume(linkedin_resume, github_repositories, job_post)
120
 
121
  except Exception as e:
122
  logger.error("Resume generation failed: %s", str(e))
 
124
  logger.warning("Resume generation skipped - content missing")
125
 
126
  return result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resumate.py CHANGED
@@ -78,7 +78,7 @@ with gr.Blocks() as demo:
78
  )
79
 
80
  submit_btn = gr.Button("Submit")
81
- output = gr.Textbox(label="Output", lines=5, max_lines=50, show_copy_button=True)
82
 
83
  submit_btn.click( # pylint: disable=no-member
84
  process_inputs,
 
78
  )
79
 
80
  submit_btn = gr.Button("Submit")
81
+ output = gr.Textbox(label="Output", lines=5, show_copy_button=True)
82
 
83
  submit_btn.click( # pylint: disable=no-member
84
  process_inputs,