Spaces:
Paused
Paused
add process_whole_doc fun in app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,8 @@ from fastapi import FastAPI, UploadFile, File
|
|
| 22 |
from fastapi.responses import HTMLResponse
|
| 23 |
import shutil
|
| 24 |
from inference import process_document
|
|
|
|
|
|
|
| 25 |
|
| 26 |
app = FastAPI()
|
| 27 |
|
|
@@ -47,6 +49,7 @@ async def extract(file: UploadFile = File(...)):
|
|
| 47 |
with open(file_path, "wb") as buffer:
|
| 48 |
shutil.copyfileobj(file.file, buffer)
|
| 49 |
|
| 50 |
-
result = process_document(file_path)
|
|
|
|
| 51 |
|
| 52 |
return {"result": result}
|
|
|
|
| 22 |
from fastapi.responses import HTMLResponse
|
| 23 |
import shutil
|
| 24 |
from inference import process_document
|
| 25 |
+
from json_handling import process_whole_doc
|
| 26 |
+
|
| 27 |
|
| 28 |
app = FastAPI()
|
| 29 |
|
|
|
|
| 49 |
with open(file_path, "wb") as buffer:
|
| 50 |
shutil.copyfileobj(file.file, buffer)
|
| 51 |
|
| 52 |
+
# result = process_document(file_path)
|
| 53 |
+
result = process_whole_doc(file_path)
|
| 54 |
|
| 55 |
return {"result": result}
|