ghaithoun commited on
Commit
93dd6b6
1 Parent(s): 300a4b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,7 @@ def download_file(url):
9
  """Download a file from a given URL and save it to a temporary location."""
10
  try:
11
  response = requests.get(url)
12
- response.raise_for_status() # Raise an error for bad responses
13
 
14
  # Define the path for the temporary file
15
  temp_file_path = os.path.join('/tmp', os.path.basename(url))
@@ -55,7 +55,7 @@ def analyze_resume_with_job_description(resume_text, job_description, api_key):
55
 
56
  def extract_info_from_resumes(resume_paths, job_description):
57
  """Extract information from multiple resumes and analyze them against the job description."""
58
- api_key = "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" # Replace with your OpenAI API key
59
  results = []
60
 
61
  for resume_path in resume_paths:
@@ -95,8 +95,8 @@ iface = gr.Interface(
95
  gr.Textbox(label="Job Description", lines=5, placeholder="Enter the job description here..."),
96
  gr.Textbox(label="File URLs (comma-separated)", lines=2, placeholder="Enter resume file URLs here, separated by commas...")
97
  ],
98
- outputs="json", # Change output type to JSON
99
- title="Resume Analysis Tool v1.3",
100
  description="Upload your resumes via URLs, and analyze them against a job description."
101
  )
102
 
 
9
  """Download a file from a given URL and save it to a temporary location."""
10
  try:
11
  response = requests.get(url)
12
+ response.raise_for_status()
13
 
14
  # Define the path for the temporary file
15
  temp_file_path = os.path.join('/tmp', os.path.basename(url))
 
55
 
56
  def extract_info_from_resumes(resume_paths, job_description):
57
  """Extract information from multiple resumes and analyze them against the job description."""
58
+ api_key = os.environ.get("OPENAI_API_KEY") # Securely retrieve your OpenAI API key
59
  results = []
60
 
61
  for resume_path in resume_paths:
 
95
  gr.Textbox(label="Job Description", lines=5, placeholder="Enter the job description here..."),
96
  gr.Textbox(label="File URLs (comma-separated)", lines=2, placeholder="Enter resume file URLs here, separated by commas...")
97
  ],
98
+ outputs="json",
99
+ title="Resume Analysis Tool v1 openai",
100
  description="Upload your resumes via URLs, and analyze them against a job description."
101
  )
102