Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from marker.pdf import PDF # Updated import path
|
3 |
import os
|
|
|
4 |
|
5 |
def convert_pdf(input_file, output_format):
|
6 |
"""
|
|
|
1 |
+
import subprocess
|
2 |
+
import sys
|
3 |
+
|
4 |
+
# Install the 'marker' package from GitHub if not already installed
|
5 |
+
try:
|
6 |
+
import marker
|
7 |
+
except ImportError:
|
8 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "git+https://github.com/VikParuchuri/marker.git"])
|
9 |
+
|
10 |
+
# Verify the marker package is installed and check its contents
|
11 |
+
import marker
|
12 |
+
print("Available modules in marker:", dir(marker))
|
13 |
+
|
14 |
from marker.pdf import PDF # Updated import path
|
15 |
import os
|
16 |
+
import gradio as gr
|
17 |
|
18 |
def convert_pdf(input_file, output_format):
|
19 |
"""
|