Manas281 commited on
Commit
ce5b387
Β·
verified Β·
1 Parent(s): 69b7570

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -38,7 +38,8 @@ genai.configure(api_key=GEMINI_API_KEY)
38
 
39
  # Set up generative model
40
  model = genai.GenerativeModel('gemini-pro')
41
-
 
42
  #st.sidebar.title("Select AI Model")
43
 
44
  # model_name = st.sidebar.selectbox("Select AI Model", [
@@ -61,6 +62,7 @@ model = genai.GenerativeModel('gemini-pro')
61
 
62
  st.title("πŸ•΅οΈ Recruitment AI πŸ€–")
63
 
 
64
  def create_job_post(job_title, location, exp,salary_range,other_input):
65
  prompt = (
66
  f"Create a job opening post for platforms like Internshala, LinkedIn, and Naukri.com. "
@@ -71,18 +73,15 @@ def create_job_post(job_title, location, exp,salary_range,other_input):
71
 
72
  try:
73
  # Replace 'model.generate_content' with the actual method to generate content
74
- response = model.generate_content(prompt) # assuming 'model' is defined elsewhere
75
- return response.text
76
  except Exception as e:
77
  return f"Error generating response: {e}"
78
 
79
 
80
- # Streamlit app title
81
-
82
 
83
  with st.form("job_post_form"):
84
  st.write("πŸ“ Fill in the details to create a job post ✍🏼 :")
85
- st.write(" ───────────────────────────────────────────────────────────")
86
 
87
  left, right = st.columns(2)
88
  with left:
@@ -95,7 +94,6 @@ with st.form("job_post_form"):
95
 
96
  other_input = st.text_input("Enter any other details you want to add in the job post:")
97
 
98
- st.write(" ───────────────────────────────────────────────────────────")
99
 
100
  # Form submission button
101
  submitted = st.form_submit_button("Create Job Post βœ…")
@@ -115,8 +113,7 @@ job_post = create_job_post(job_title, location, exp, salary_range,other_input)
115
 
116
  # Resume scoring section
117
 
118
- llm = ChatGroq(groq_api_key=api_key, model_name="gemma2-9b-it")
119
- llm_2 = ChatGroq(groq_api_key=api_key, model_name="gemma-7b-it")
120
 
121
 
122
 
@@ -289,12 +286,10 @@ def process_pdfs_in_batches(files):
289
  )
290
 
291
 
292
- st.write(" ───────────────────────────────────────────────────────────")
293
  st.write("πŸ“‚ Upload the resumes to score them πŸ“‘:")
294
 
295
  uploaded_files = st.file_uploader("Choose PDF files", type="pdf", accept_multiple_files=True)
296
 
297
- st.write(" ───────────────────────────────────────────────────────────")
298
  if st.button("Score Resumesβœ”οΈ"):
299
  if uploaded_files:
300
  process_pdfs_in_batches(uploaded_files)
 
38
 
39
  # Set up generative model
40
  model = genai.GenerativeModel('gemini-pro')
41
+ llm = ChatGroq(groq_api_key=api_key, model_name="gemma2-9b-it")
42
+ llm_2 = ChatGroq(groq_api_key=api_key, model_name="gemma-7b-it")
43
  #st.sidebar.title("Select AI Model")
44
 
45
  # model_name = st.sidebar.selectbox("Select AI Model", [
 
62
 
63
  st.title("πŸ•΅οΈ Recruitment AI πŸ€–")
64
 
65
+
66
  def create_job_post(job_title, location, exp,salary_range,other_input):
67
  prompt = (
68
  f"Create a job opening post for platforms like Internshala, LinkedIn, and Naukri.com. "
 
73
 
74
  try:
75
  # Replace 'model.generate_content' with the actual method to generate content
76
+ response = llm_2.invoke(prompt) # assuming 'model' is defined elsewhere
77
+ return response.content
78
  except Exception as e:
79
  return f"Error generating response: {e}"
80
 
81
 
 
 
82
 
83
  with st.form("job_post_form"):
84
  st.write("πŸ“ Fill in the details to create a job post ✍🏼 :")
 
85
 
86
  left, right = st.columns(2)
87
  with left:
 
94
 
95
  other_input = st.text_input("Enter any other details you want to add in the job post:")
96
 
 
97
 
98
  # Form submission button
99
  submitted = st.form_submit_button("Create Job Post βœ…")
 
113
 
114
  # Resume scoring section
115
 
116
+
 
117
 
118
 
119
 
 
286
  )
287
 
288
 
 
289
  st.write("πŸ“‚ Upload the resumes to score them πŸ“‘:")
290
 
291
  uploaded_files = st.file_uploader("Choose PDF files", type="pdf", accept_multiple_files=True)
292
 
 
293
  if st.button("Score Resumesβœ”οΈ"):
294
  if uploaded_files:
295
  process_pdfs_in_batches(uploaded_files)