Spaces:
Configuration error
Configuration error
Added logic to handle case where user does not provide job call text and default job call text does not exist.
Browse files- functions/gradio.py +29 -10
functions/gradio.py
CHANGED
@@ -148,19 +148,34 @@ def process_inputs(linkedin_pdf, github_url, job_post_text, user_instructions):
|
|
148 |
else:
|
149 |
result += "ℹ️ No job post provided, attempting to use default\n"
|
150 |
logger.info("No job post text provided, trying default")
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
# Generate job summary (will use default if job_text_to_use is None)
|
154 |
-
summary =
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
else:
|
162 |
-
result += "
|
163 |
-
logger.
|
164 |
|
165 |
# Process user instructions
|
166 |
if user_instructions and user_instructions.strip():
|
@@ -214,6 +229,10 @@ def get_processed_data(linkedin_pdf, github_url, job_post_text, instructions):
|
|
214 |
|
215 |
if default_job:
|
216 |
job_post_text = default_job
|
|
|
|
|
|
|
|
|
217 |
|
218 |
processed_data = {
|
219 |
"linkedin": None,
|
|
|
148 |
else:
|
149 |
result += "ℹ️ No job post provided, attempting to use default\n"
|
150 |
logger.info("No job post text provided, trying default")
|
151 |
+
|
152 |
+
# Try to load default job call
|
153 |
+
default_job = load_default_job_call()
|
154 |
+
if default_job:
|
155 |
+
job_text_to_use = default_job
|
156 |
+
else:
|
157 |
+
result += "ℹ️ No default job post available, proceeding without job post\n"
|
158 |
+
logger.info("No default job post available, proceeding without job analysis")
|
159 |
+
job_text_to_use = None
|
160 |
|
161 |
# Generate job summary (will use default if job_text_to_use is None)
|
162 |
+
summary = None
|
163 |
+
if job_text_to_use:
|
164 |
+
summary = summarize_job_call(job_text_to_use)
|
165 |
+
|
166 |
+
if summary:
|
167 |
+
if job_post_text and job_post_text.strip():
|
168 |
+
result += " ✅ Job post summary generated\n"
|
169 |
+
else:
|
170 |
+
result += "✅ Using default job post\n"
|
171 |
+
result += " ✅ Job post summary generated\n"
|
172 |
+
logger.info("Job post summary generated (%d characters)", len(summary))
|
173 |
+
else:
|
174 |
+
result += " ❌ Job post summary generation failed\n"
|
175 |
+
logger.warning("Job post summary generation failed")
|
176 |
else:
|
177 |
+
result += "ℹ️ Proceeding without job post analysis\n"
|
178 |
+
logger.info("No job post available for analysis")
|
179 |
|
180 |
# Process user instructions
|
181 |
if user_instructions and user_instructions.strip():
|
|
|
229 |
|
230 |
if default_job:
|
231 |
job_post_text = default_job
|
232 |
+
else:
|
233 |
+
# No job post provided and no default available - proceed without job post
|
234 |
+
logger.info("No job post provided and no default available, proceeding without job analysis")
|
235 |
+
job_post_text = None
|
236 |
|
237 |
processed_data = {
|
238 |
"linkedin": None,
|