Spaces:
Runtime error
Runtime error
Liam Dyer
commited on
π
Browse files
app.py
CHANGED
|
@@ -1,12 +1,8 @@
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
-
from marker.convert import convert_single_pdf
|
| 4 |
-
from marker.models import load_all_models
|
| 5 |
import surya.detection as detection
|
| 6 |
import surya.layout as layout
|
| 7 |
|
| 8 |
-
model_lst = load_all_models()
|
| 9 |
-
|
| 10 |
|
| 11 |
# Monkey patch to prevent spawning processes
|
| 12 |
def batch_text_detection(images, model, processor, batch_size=None):
|
|
@@ -47,6 +43,11 @@ def batch_layout_detection(
|
|
| 47 |
|
| 48 |
layout.batch_layout_detection = batch_layout_detection
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
@spaces.GPU
|
| 52 |
def convert(file_path):
|
|
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
|
|
|
|
|
|
| 3 |
import surya.detection as detection
|
| 4 |
import surya.layout as layout
|
| 5 |
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Monkey patch to prevent spawning processes
|
| 8 |
def batch_text_detection(images, model, processor, batch_size=None):
|
|
|
|
| 43 |
|
| 44 |
layout.batch_layout_detection = batch_layout_detection
|
| 45 |
|
| 46 |
+
from marker.convert import convert_single_pdf
|
| 47 |
+
from marker.models import load_all_models
|
| 48 |
+
|
| 49 |
+
model_lst = load_all_models()
|
| 50 |
+
|
| 51 |
|
| 52 |
@spaces.GPU
|
| 53 |
def convert(file_path):
|