Spaces:
Sleeping
Sleeping
Update endpoints.py
Browse files- endpoints.py +13 -1
endpoints.py
CHANGED
@@ -12,6 +12,14 @@ from routers.donut_inference import process_document_donut
|
|
12 |
|
13 |
app = FastAPI(openapi_url="/api/v1/sparrow-ml/openapi.json", docs_url="/api/v1/sparrow-ml/docs")
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
app.include_router(inference.router, prefix="/api-inference/v1/sparrow-ml", tags=["Inference"])
|
16 |
app.include_router(training.router, prefix="/api-training/v1/sparrow-ml", tags=["Training"])
|
17 |
|
@@ -80,4 +88,8 @@ async def get_statistics():
|
|
80 |
else:
|
81 |
content = []
|
82 |
|
83 |
-
return content
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
app = FastAPI(openapi_url="/api/v1/sparrow-ml/openapi.json", docs_url="/api/v1/sparrow-ml/docs")
|
14 |
|
15 |
+
app.add_middleware(
|
16 |
+
CORSMiddleware,
|
17 |
+
allow_origins=["*"],
|
18 |
+
allow_methods=["*"],
|
19 |
+
allow_headers=["*"],
|
20 |
+
allow_credentials=True,
|
21 |
+
)
|
22 |
+
|
23 |
app.include_router(inference.router, prefix="/api-inference/v1/sparrow-ml", tags=["Inference"])
|
24 |
app.include_router(training.router, prefix="/api-training/v1/sparrow-ml", tags=["Training"])
|
25 |
|
|
|
88 |
else:
|
89 |
content = []
|
90 |
|
91 |
+
return content
|
92 |
+
|
93 |
+
@app.get("/")
|
94 |
+
async def root():
|
95 |
+
return {"message": "Naivas LPO inferencing"}
|