Witold Wydmański commited on
Commit
ec8af9d
·
1 Parent(s): 43938ad

fix: remove `if name=="main"` from the script

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -37,14 +37,12 @@ def tesseract_ocr(image, progress=gr.Progress()):
37
 
38
 
39
  logging.info("Starting Tesseract OCR")
40
- if __name__=="__main__":
41
- logging.info("Running Gradio Interface")
42
- iface = gr.Interface(
43
- fn=tesseract_ocr,
44
- inputs=[gr.File(label="PDF file")],
45
- outputs=gr.File(label="Text file", type="file", encoding="utf-8"),
46
- title="PDF to Text Converter",
47
- description="Converts a PDF file to text using Tesseract OCR.",
48
- ).queue(concurrency_count=10)
49
 
50
- iface.launch()
 
37
 
38
 
39
  logging.info("Starting Tesseract OCR")
40
+ iface = gr.Interface(
41
+ fn=tesseract_ocr,
42
+ inputs=[gr.File(label="PDF file")],
43
+ outputs=gr.File(label="Text file", type="file", encoding="utf-8"),
44
+ title="PDF to Text Converter",
45
+ description="Converts a PDF file to text using Tesseract OCR.",
46
+ ).queue(concurrency_count=10)
 
 
47
 
48
+ iface.launch()