andreeabodea commited on
Commit
4e296b6
1 Parent(s): 651d696

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -112,12 +112,18 @@ def get_first_page_text(file_data):
112
  if len(doc.pages):
113
  return doc.pages[0].extract_text()
114
 
115
- # Define the Gradio interface
116
- # iface = gr.Interface(fn=process_pdf,
117
- iface = gr.Interface(fn=get_first_page_text,
 
 
118
  inputs=gr.File(type="binary", label="Upload PDF"),
119
  outputs=gr.Textbox(label="Extracted Text"),
120
  title="PDF Text Extractor",
121
  description="Upload a PDF file to extract.")
 
 
 
 
 
122
 
123
- iface.launch()
 
112
  if len(doc.pages):
113
  return doc.pages[0].extract_text()
114
 
115
+ if __name__ == "__main__":
116
+
117
+ # Define the Gradio interface
118
+ # iface = gr.Interface(fn=process_pdf,
119
+ demo = gr.Interface(fn=get_first_page_text,
120
  inputs=gr.File(type="binary", label="Upload PDF"),
121
  outputs=gr.Textbox(label="Extracted Text"),
122
  title="PDF Text Extractor",
123
  description="Upload a PDF file to extract.")
124
+ demo.launch()
125
+
126
+
127
+
128
+
129