Mishmosh commited on
Commit
208b94d
·
1 Parent(s): 3da38ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -1,10 +1,21 @@
1
  # https://huggingface.co/spaces/Mishmosh/MichelleAssessment3
2
  import gradio as gr
 
 
 
 
 
 
3
  def process_input(pdf_file):
4
  print("Received PDF File:", pdf_file.name)
 
 
 
5
  with open("received_pdf.pdf", "wb") as output_file:
6
- output_file.write(pdf_file.read())
7
- return None
 
 
8
 
9
  iface = gr.Interface(
10
  fn=process_input,
 
1
  # https://huggingface.co/spaces/Mishmosh/MichelleAssessment3
2
  import gradio as gr
3
+ #def process_input(pdf_file):
4
+ # print("Received PDF File:", pdf_file.name)
5
+ # with open("received_pdf.pdf", "wb") as output_file:
6
+ # output_file.write(pdf_file.read())
7
+ #return None
8
+
9
  def process_input(pdf_file):
10
  print("Received PDF File:", pdf_file.name)
11
+ # Read the content of the uploaded PDF file
12
+ pdf_content = pdf_file.read()
13
+ # Save the received PDF content locally
14
  with open("received_pdf.pdf", "wb") as output_file:
15
+ output_file.write(pdf_content)
16
+ # Return the content of the processed PDF file
17
+ return pdf_content
18
+
19
 
20
  iface = gr.Interface(
21
  fn=process_input,