semmyk commited on
Commit
44c8b0c
·
1 Parent(s): 3be88d9

duplicate main.py to app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # main.py
2
+ """
3
+ rename main.py to app.py
4
+ HF Spaces Error despite including and restructioning yaml section:
5
+ python: can't open file '/home/user/app/app.py': [Errno 2] No such file or directory
6
+ === Application stopped (exit code: 2) at 2025-09-17 23:41:30.360053348 UTC ===
7
+ """
8
+
9
+ import os
10
+ from pathlib import Path
11
+
12
+ from ui.gradio_ui import build_interface
13
+ from utils.logger import get_logger, setup_logging
14
+
15
+ setup_logging() ## set logging
16
+ #logger = get_logger("pypdfmd")
17
+ logger = get_logger("parserpdf")
18
+
19
+ if __name__ == "__main__":
20
+ # Ensure the working directory is clean
21
+ #os.chdir(os.path.dirname(__file__))
22
+ ## script working dir absolute path
23
+ script_dir = Path(__file__).resolve().parent
24
+ ## change the cwd to the script's dir
25
+ os.chdir(script_dir) ##Path.cwd()
26
+
27
+ demo = build_interface()
28
+ #demo.launch(debug=True, show_error=True ,ssr_mode=True) #(share=True) # share=True for public link; remove in production
29
+ demo.launch(debug=True, show_error=True)