tahirsher commited on
Commit
3add62e
1 Parent(s): 49e3224

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -31,11 +31,6 @@ def run_with_timeout(target_func, timeout, *args, **kwargs):
31
  raise exception[0]
32
  return result[0]
33
 
34
- # Example function to simulate a long task (you can replace it with your actual task)
35
- def example_long_task():
36
- time.sleep(10) # Simulating a task that takes 10 seconds
37
- return "Task completed successfully."
38
-
39
  # Load QA pipeline for Q&A session
40
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
41
 
@@ -79,14 +74,16 @@ if "profile_data" in st.session_state:
79
  # Job Recommendations
80
  st.write("### Job Recommendations:")
81
  for job in jobs_dataset:
82
- job_skills = [skill.lower() for skill in job["job_skills"]]
83
- if any(skill in job_skills for skill in tech_skills):
84
- st.write(f"- **{job['job_title']}** at {job['company_name']}, Location: {job['job_location']}")
 
 
85
 
86
  # Course Recommendations
87
  st.write("### Course Recommendations:")
88
  for course in courses_dataset:
89
- course_skills = [skill.lower() for skill in course["Skills"]]
90
  if any(interest in course["Title"].lower() for interest in interests):
91
  st.write(f"- **{course['Title']}** by {course['Organization']}. [Link to course]({course['course_url']})")
92
 
 
31
  raise exception[0]
32
  return result[0]
33
 
 
 
 
 
 
34
  # Load QA pipeline for Q&A session
35
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
36
 
 
74
  # Job Recommendations
75
  st.write("### Job Recommendations:")
76
  for job in jobs_dataset:
77
+ job_skills = job.get("job_skills", [])
78
+ if job_skills is not None: # Check if job_skills is not None
79
+ job_skills = [skill.lower() for skill in job_skills] # Lowercase the skills
80
+ if any(skill in job_skills for skill in tech_skills):
81
+ st.write(f"- **{job['job_title']}** at {job['company_name']}, Location: {job['job_location']}")
82
 
83
  # Course Recommendations
84
  st.write("### Course Recommendations:")
85
  for course in courses_dataset:
86
+ course_skills = [skill.lower() for skill in course["Skills"]] if course["Skills"] is not None else []
87
  if any(interest in course["Title"].lower() for interest in interests):
88
  st.write(f"- **{course['Title']}** by {course['Organization']}. [Link to course]({course['course_url']})")
89