Spaces:
Sleeping
Sleeping
Commit
·
9c0b6a9
1
Parent(s):
2dbea89
Update PDF to Markdown converter API with NVIDIA L4 support
Browse files- app.py +9 -1
- app/__init__.py +3 -0
app.py
CHANGED
@@ -3,8 +3,16 @@ Simple entry point for Hugging Face Spaces.
|
|
3 |
This file redirects to the FastAPI app in the app directory.
|
4 |
"""
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
from app.main import app
|
7 |
|
8 |
if __name__ == "__main__":
|
9 |
import uvicorn
|
10 |
-
uvicorn.run(
|
|
|
3 |
This file redirects to the FastAPI app in the app directory.
|
4 |
"""
|
5 |
|
6 |
+
# Import the app directly without using package notation
|
7 |
+
import sys
|
8 |
+
import os
|
9 |
+
|
10 |
+
# Add the current directory to the path so Python can find the app module
|
11 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
12 |
+
|
13 |
+
# Import the app from main.py in the app directory
|
14 |
from app.main import app
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
import uvicorn
|
18 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
app/__init__.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
This file makes the app directory a proper Python package.
|
3 |
+
"""
|