mahika123 commited on
Commit
8e89e2d
·
verified ·
1 Parent(s): 379a41b
Files changed (1) hide show
  1. app.py +15 -77
app.py CHANGED
@@ -84,86 +84,28 @@ def show_info(topic):
84
  }
85
  return responses.get(topic, "Select a category to see the corresponding careers.")
86
 
87
- # Resources Page
88
- def resource_block(career):
89
- yt_videos = {
90
- "AI/Machine Learning Engineer": '<iframe width="100%" height="315" src="https://www.youtube.com/embed/ukzFI9rgwfU" title="AI Career Advice" frameborder="0" allowfullscreen></iframe>',
91
- "Data Scientist": '<iframe width="100%" height="315" src="https://www.youtube.com/embed/xC-c7E5PK0Y" title="Day in the Life of Data Scientist" frameborder="0" allowfullscreen></iframe>',
92
- "Cloud Solutions Architect": '<iframe width="100%" height="315" src="https://www.youtube.com/embed/COgFYt6GxC4" title="Become a Cloud Architect" frameborder="0" allowfullscreen></iframe>'
93
- }
94
-
95
- resources = {
96
- "AI/Machine Learning Engineer": {
97
- "links": [
98
- ("Neural Networks – DeepLearning.AI", "https://www.deeplearning.ai"),
99
- ("Build ML Models – Fast.ai", "https://www.fast.ai"),
100
- ("Machine Learning – Stanford CS229", "https://cs229.stanford.edu/")
101
- ],
102
- "college": {
103
- "major": "Computer Science, Data Science",
104
- "classes": [
105
- "CS50: Introduction to Computer Science (Harvard)",
106
- "Linear Algebra",
107
- "Probability and Statistics",
108
- "Machine Learning (Stanford CS229)",
109
- "Algorithms"
110
- ]
111
- }
112
- },
113
- "Data Scientist": {
114
- "links": [
115
- ("Python & Pandas – Kaggle Learn", "https://www.kaggle.com/learn"),
116
- ("R Programming – Harvard Data Science", "https://online-learning.harvard.edu/series/data-science"),
117
- ("Project Practice – DataCamp", "https://www.datacamp.com")
118
- ],
119
- "college": {
120
- "major": "Data Science, Statistics, Computer Science",
121
- "classes": [
122
- "Introduction to Data Science",
123
- "Statistics and Probability",
124
- "Data Mining",
125
- "Machine Learning",
126
- "Database Systems"
127
- ]
128
- }
129
- },
130
- "Cloud Solutions Architect": {
131
- "links": [
132
- ("AWS Skills – AWS Training", "https://aws.amazon.com/training/"),
133
- ("Azure Certifications – Microsoft Learn", "https://learn.microsoft.com/en-us/certifications/"),
134
- ("Google Cloud Labs – Google Cloud Boost", "https://cloudskillsboost.google/")
135
- ],
136
- "college": {
137
- "major": "Computer Science, Information Technology",
138
- "classes": [
139
- "Cloud Computing Fundamentals",
140
- "Computer Networks",
141
- "Systems Design",
142
- "Information Security",
143
- "Operating Systems"
144
- ]
145
- }
146
- }
147
- }
148
 
149
- content = resources.get(career)
 
150
  if not content:
151
  return "Select a career to see resources.", ""
152
 
153
- link_html = "<h4>Skills</h4><ul>"
154
- for label, url in content["links"]:
155
  link_html += f"<li><strong>{label}</strong>: <a href='{url}' target='_blank'>{url}</a></li>"
156
- link_html += "</ul><br><hr><br>"
157
 
158
- college_html = "<h4>College & Classes</h4><ul>"
159
- college_html += f"<li><strong>Majors:</strong> {content['college']['major']}</li>"
160
  college_html += "<li><strong>Helpful Classes:</strong><ul>"
161
- for cls in content['college']['classes']:
162
- college_html += f"<li>{cls}</li>"
163
- college_html += "</ul></li></ul><br><hr><br>"
164
 
165
- video_embed = yt_videos.get(career, "")
166
- return link_html + college_html, video_embed
167
 
168
  # UI Layout
169
  with gr.Blocks(theme=theme, css=custom_css) as chatbot:
@@ -196,11 +138,7 @@ with gr.Blocks(theme=theme, css=custom_css) as chatbot:
196
  with gr.Tab("Resources"):
197
  gr.Markdown("### Career-Specific Educational Resources")
198
  dropdown_resources = gr.Dropdown(
199
- choices=[
200
- "AI/Machine Learning Engineer",
201
- "Data Scientist",
202
- "Cloud Solutions Architect"
203
- ],
204
  label="Choose a Career"
205
  )
206
  output_links = gr.HTML()
 
84
  }
85
  return responses.get(topic, "Select a category to see the corresponding careers.")
86
 
87
+ # Load 20 career resource entries from external file or definition
88
+ from resource_data import career_resources # This file should define a dictionary named `career_resources`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
+ def resource_block(career):
91
+ content = career_resources.get(career)
92
  if not content:
93
  return "Select a career to see resources.", ""
94
 
95
+ link_html = "<h4>\ud83e\udde0 Skills</h4><ul>"
96
+ for label, url in content["skills"]:
97
  link_html += f"<li><strong>{label}</strong>: <a href='{url}' target='_blank'>{url}</a></li>"
98
+ link_html += "</ul><br>"
99
 
100
+ college_html = "<h4>\ud83c\udf93 College & Classes</h4><ul>"
101
+ college_html += f"<li><strong>Majors:</strong> {content['major']}</li>"
102
  college_html += "<li><strong>Helpful Classes:</strong><ul>"
103
+ for course in content["classes"]:
104
+ college_html += f"<li>{course}</li>"
105
+ college_html += "</ul></li></ul><hr>"
106
 
107
+ video_embed = content.get("youtube", "")
108
+ return link_html + "<br>" + college_html, video_embed
109
 
110
  # UI Layout
111
  with gr.Blocks(theme=theme, css=custom_css) as chatbot:
 
138
  with gr.Tab("Resources"):
139
  gr.Markdown("### Career-Specific Educational Resources")
140
  dropdown_resources = gr.Dropdown(
141
+ choices=list(career_resources.keys()),
 
 
 
 
142
  label="Choose a Career"
143
  )
144
  output_links = gr.HTML()