ApsidalSolid4 commited on
Commit
728b3fe
·
verified ·
1 Parent(s): 8be381d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -833,7 +833,6 @@ def setup_gradio_interface(classifier):
833
  output_sentences = gr.Textbox(label="Sentence-by-Sentence Analysis", lines=10)
834
  output_result = gr.Textbox(label="Overall Result", lines=4)
835
 
836
- # FIXED: Use wrapper function that doesn't include classifier as a parameter
837
  text_submit_button.click(
838
  analyze_text_wrapper,
839
  inputs=[text_input, mode_selection],
@@ -841,10 +840,11 @@ def setup_gradio_interface(classifier):
841
  )
842
 
843
  with gr.Tab("File Upload"):
 
844
  file_upload = gr.File(
845
  label="Upload Document",
846
  file_types=["image", "pdf", "doc", "docx"],
847
- type="file"
848
  )
849
 
850
  file_mode_selection = gr.Radio(
@@ -860,7 +860,6 @@ def setup_gradio_interface(classifier):
860
  file_output_sentences = gr.Textbox(label="Sentence-by-Sentence Analysis", lines=10)
861
  file_output_result = gr.Textbox(label="Overall Result", lines=4)
862
 
863
- # FIXED: Use wrapper function that doesn't include classifier as a parameter
864
  upload_submit_button.click(
865
  handle_file_upload_wrapper,
866
  inputs=[file_upload, file_mode_selection],
 
833
  output_sentences = gr.Textbox(label="Sentence-by-Sentence Analysis", lines=10)
834
  output_result = gr.Textbox(label="Overall Result", lines=4)
835
 
 
836
  text_submit_button.click(
837
  analyze_text_wrapper,
838
  inputs=[text_input, mode_selection],
 
840
  )
841
 
842
  with gr.Tab("File Upload"):
843
+ # FIXED: Changed type="file" to type="binary"
844
  file_upload = gr.File(
845
  label="Upload Document",
846
  file_types=["image", "pdf", "doc", "docx"],
847
+ type="binary"
848
  )
849
 
850
  file_mode_selection = gr.Radio(
 
860
  file_output_sentences = gr.Textbox(label="Sentence-by-Sentence Analysis", lines=10)
861
  file_output_result = gr.Textbox(label="Overall Result", lines=4)
862
 
 
863
  upload_submit_button.click(
864
  handle_file_upload_wrapper,
865
  inputs=[file_upload, file_mode_selection],