Spaces:
Runtime error
Runtime error
Witold Wydmański
commited on
Commit
·
ec8af9d
1
Parent(s):
43938ad
fix: remove `if name=="main"` from the script
Browse files
app.py
CHANGED
@@ -37,14 +37,12 @@ def tesseract_ocr(image, progress=gr.Progress()):
|
|
37 |
|
38 |
|
39 |
logging.info("Starting Tesseract OCR")
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
description="Converts a PDF file to text using Tesseract OCR.",
|
48 |
-
).queue(concurrency_count=10)
|
49 |
|
50 |
-
|
|
|
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()
|