-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (19 loc) · 844 Bytes
/
Copy pathmain.py
File metadata and controls
25 lines (19 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# main.py
import os
from pathlib import Path
from ui.gradio_ui import build_interface
from utils.logger import get_logger, setup_logging
setup_logging() ## set logging
#logger = get_logger("pypdfmd")
logger = get_logger("parserpdf")
if __name__ == "__main__":
# Ensure the working directory is clean
#os.chdir(os.path.dirname(__file__))
## script working dir absolute path
script_dir = Path(__file__).resolve().parent
## change the cwd to the script's dir
os.chdir(script_dir) ##Path.cwd()
demo = build_interface()
demo.queue() # Enables queue to prevent user's browser premature timeout > 60s
#demo.launch(debug=True, show_error=True ,ssr_mode=True) #(share=True) # share=True for public link; remove in production
demo.launch(debug=True, show_error=True, ssr_mode=True,) #ssr_mode=False