edouardlgp commited on
Commit
ac17970
·
verified ·
1 Parent(s): ea0ad80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -700,19 +700,21 @@ def process_pdf(file):
700
  for i in range(1, 6) for field in ["code", "name", "desc"]},
701
  "skills_esco": None
702
  })
703
- return result
 
 
 
704
  except Exception as e:
705
- return f"Error processing PDF: {str(e)}"
 
706
 
707
  with gr.Blocks() as demo:
708
  gr.Markdown("# Standardize Job Description!")
709
  gr.Markdown("Identify Job Family, Occupation, Qualification, match Skills and suggest interview questions.")
710
  with gr.Row():
711
  with gr.Column():
712
- file_input = gr.File(label="Upload a Post Description PDF file", file_types=[".pdf"])
713
  submit_btn = gr.Button("Analyse Post Description")
714
- # with gr.Column():
715
- # text_output = gr.Textbox(label="Extracted Text", lines=30, max_lines=50, interactive=False)
716
  with gr.Column():
717
  text_output = gr.Textbox(label="Extracted Text", lines=30, max_lines=50, interactive=False)
718
  if DEBUG:
@@ -723,10 +725,10 @@ with gr.Blocks() as demo:
723
  lines=15,
724
  elem_classes=["debug-console"]
725
  )
 
726
  submit_btn.click(
727
  fn=process_pdf,
728
  inputs=file_input,
729
- #outputs=text_output
730
  outputs=[text_output, debug_console] if DEBUG else [text_output],
731
  )
732
 
 
700
  for i in range(1, 6) for field in ["code", "name", "desc"]},
701
  "skills_esco": None
702
  })
703
+
704
+ debug_message = "Processing completed successfully."
705
+ return result, debug_message
706
+
707
  except Exception as e:
708
+ error_message = f"Error processing PDF: {str(e)}"
709
+ return error_message, error_message
710
 
711
  with gr.Blocks() as demo:
712
  gr.Markdown("# Standardize Job Description!")
713
  gr.Markdown("Identify Job Family, Occupation, Qualification, match Skills and suggest interview questions.")
714
  with gr.Row():
715
  with gr.Column():
716
+ file_input = gr.File(label="Upload a Post Description PDF file - not a scan!", file_types=[".pdf"])
717
  submit_btn = gr.Button("Analyse Post Description")
 
 
718
  with gr.Column():
719
  text_output = gr.Textbox(label="Extracted Text", lines=30, max_lines=50, interactive=False)
720
  if DEBUG:
 
725
  lines=15,
726
  elem_classes=["debug-console"]
727
  )
728
+
729
  submit_btn.click(
730
  fn=process_pdf,
731
  inputs=file_input,
 
732
  outputs=[text_output, debug_console] if DEBUG else [text_output],
733
  )
734