Dannyar608 commited on
Commit
69839ee
·
verified ·
1 Parent(s): d343ff2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +82 -0
app.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pip install transformers
2
+ pip install torch
3
+
4
+ from transformers import pipeline
5
+
6
+ # Initialize the HuggingFace pipeline for text generation
7
+ generator = pipeline("text-generation", model="gpt-3")
8
+
9
+ def generate_resume(name, job_title, skills, experiences, education):
10
+ resume_template = f"""
11
+ Name: {name}
12
+ Job Title: {job_title}
13
+ Skills: {skills}
14
+ Work Experience: {experiences}
15
+ Education: {education}
16
+ """
17
+
18
+ # Use the generator to enhance the resume
19
+ resume = generator(resume_template, max_length=400, num_return_sequences=1)[0]['generated_text']
20
+ return resume
21
+
22
+ # Example usage
23
+ name = "John Doe"
24
+ job_title = "Software Engineer"
25
+ skills = "Python, Java, Machine Learning, Data Analysis"
26
+ experiences = "Worked as a software engineer at ABC Corp, developed web applications using Python."
27
+ education = "BSc in Computer Science from XYZ University."
28
+
29
+ resume = generate_resume(name, job_title, skills, experiences, education)
30
+ print(resume)
31
+
32
+ from transformers import pipeline
33
+
34
+ # Initialize the HuggingFace pipeline for text generation
35
+ generator = pipeline("text-generation", model="gpt-3")
36
+
37
+ def generate_interview_questions(job_role):
38
+ prompt = f"Generate a list of interview questions for a {job_role} role."
39
+
40
+ # Generate the questions using GPT
41
+ questions = generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
42
+ return questions
43
+
44
+ # Example usage
45
+ job_role = "Data Scientist"
46
+ interview_questions = generate_interview_questions(job_role)
47
+ print(interview_questions)
48
+
49
+ from transformers import pipeline
50
+
51
+ # Initialize the HuggingFace pipeline for text generation
52
+ generator = pipeline("text-generation", model="gpt-3")
53
+
54
+ def generate_interview_questions(job_role):
55
+ prompt = f"Generate a list of interview questions for a {job_role} role."
56
+
57
+ # Generate the questions using GPT
58
+ questions = generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
59
+ return questions
60
+
61
+ # Example usage
62
+ job_role = "Data Scientist"
63
+ interview_questions = generate_interview_questions(job_role)
64
+ print(interview_questions)
65
+
66
+ from transformers import pipeline
67
+
68
+ # Initialize the HuggingFace pipeline for text generation
69
+ generator = pipeline("text-generation", model="gpt-3")
70
+
71
+ def generate_career_advice(skills, interests):
72
+ prompt = f"Given the skills {skills} and interests {interests}, suggest some career paths and advice."
73
+
74
+ # Generate personalized career coaching advice
75
+ career_advice = generator(prompt, max_length=200, num_return_sequences=1)[0]['generated_text']
76
+ return career_advice
77
+
78
+ # Example usage
79
+ skills = "Data Science, Python, Machine Learning"
80
+ interests = "Artificial Intelligence, Data Analytics"
81
+ career_advice = generate_career_advice(skills, interests)
82
+ print(career_advice)