barghavani commited on
Commit
4235c40
·
verified ·
1 Parent(s): c68a703

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -12
app.py CHANGED
@@ -98,21 +98,32 @@ def match_resume_to_job_description(api_key, resume_file_content, job_descriptio
98
  return response
99
 
100
  def main():
101
- input_api_key = Textbox(label="Enter your OpenAI API Key")
102
- input_pdf_file = File(label="Upload your PDF resume", type="binary")
103
- input_job_description = Textbox(label="Enter the job description", placeholder="Paste the job description here")
104
- output_yaml = Textbox(label="Formatted Resume in YAML")
105
- output_match_score = Textbox(label="Resume Match Score")
106
-
107
- iface = gr.Interface(
108
- fn=[format_resume_to_yaml, match_resume_to_job_description],
 
 
 
 
 
 
 
 
 
109
  inputs=[input_api_key, input_pdf_file, input_job_description],
110
- outputs=[output_yaml, output_match_score],
111
- title="Resume to YAML Formatter and Matcher",
112
- description="Upload a PDF resume and enter your OpenAI API key to get it formatted to a YAML template and matched to a job description.",
113
  )
114
 
115
- iface.launch(debug=True, share=True)
 
 
116
 
117
  if __name__ == "__main__":
118
  main()
 
98
  return response
99
 
100
  def main():
101
+ input_api_key = gr.Textbox(label="Enter your OpenAI API Key")
102
+ input_pdf_file = gr.File(label="Upload your PDF resume", type="binary")
103
+ input_job_description = gr.Textbox(label="Enter the job description", placeholder="Paste the job description here")
104
+ output_yaml = gr.Textbox(label="Formatted Resume in YAML")
105
+ output_match_score = gr.Textbox(label="Resume Match Score")
106
+
107
+ # Define separate interfaces for each function to simplify
108
+ format_resume_interface = gr.Interface(
109
+ fn=format_resume_to_yaml,
110
+ inputs=[input_api_key, input_pdf_file],
111
+ outputs=output_yaml,
112
+ title="Resume to YAML Formatter",
113
+ description="Upload a PDF resume and enter your OpenAI API key to get it formatted to a YAML template.",
114
+ )
115
+
116
+ match_resume_interface = gr.Interface(
117
+ fn=match_resume_to_job_description,
118
  inputs=[input_api_key, input_pdf_file, input_job_description],
119
+ outputs=output_match_score,
120
+ title="Resume Matcher",
121
+ description="Upload a PDF resume, enter your OpenAI API key and job description to get the matching score.",
122
  )
123
 
124
+ # Launch interfaces in parallel if needed, or redesign to choose which to display based on user input
125
+ format_resume_interface.launch(debug=True, share=True)
126
+ # match_resume_interface.launch(debug=True, share=True) # Uncomment to run separately
127
 
128
  if __name__ == "__main__":
129
  main()