OverlordYashSrivastav commited on
Commit
0b3da9e
·
verified ·
1 Parent(s): db19224

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,8 +2,8 @@ import streamlit as st
2
  import openai
3
  import json
4
 
5
- #openai.api_key = st.secrets["key"]
6
- client = openai(api_key = st.secrets["key"])
7
 
8
  st.title("ATS Resume Scoring App 🚀")
9
 
@@ -26,12 +26,12 @@ if st.button("Get ATS Score"):
26
  {resume_text}
27
  """
28
 
29
- response = client.chat.completions.create(
30
  model="gpt-3.5-turbo",
31
  messages=[{"role": "user", "content": prompt}]
32
  )
33
 
34
- output = response.choices[0].message.content
35
 
36
  try:
37
  result = json.loads(output)
@@ -39,4 +39,4 @@ if st.button("Get ATS Score"):
39
  st.info(f"🧠 Feedback: {result['feedback']}")
40
  except Exception as e:
41
  st.error("Something went wrong. Try again.")
42
- st.text(output)
 
2
  import openai
3
  import json
4
 
5
+ # Set your OpenAI API key here
6
+ openai.api_key = st.secrets["key"]
7
 
8
  st.title("ATS Resume Scoring App 🚀")
9
 
 
26
  {resume_text}
27
  """
28
 
29
+ response = openai.ChatCompletion.create(
30
  model="gpt-3.5-turbo",
31
  messages=[{"role": "user", "content": prompt}]
32
  )
33
 
34
+ output = response.choices[0].message["content"]
35
 
36
  try:
37
  result = json.loads(output)
 
39
  st.info(f"🧠 Feedback: {result['feedback']}")
40
  except Exception as e:
41
  st.error("Something went wrong. Try again.")
42
+ st.text(output)