Spaces:
Paused
Paused
Daniel Marques
commited on
Commit
·
03a8594
1
Parent(s):
311a66b
feat: add upload file
Browse files
main.py
CHANGED
@@ -137,7 +137,7 @@ def run_ingest_route():
|
|
137 |
except Exception as e:
|
138 |
raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
|
139 |
|
140 |
-
@api_app.get("/api/delete_source"
|
141 |
def delete_source_route():
|
142 |
folder_name = "SOURCE_DOCUMENTS"
|
143 |
|
@@ -146,7 +146,7 @@ def delete_source_route():
|
|
146 |
|
147 |
os.makedirs(folder_name)
|
148 |
|
149 |
-
return
|
150 |
|
151 |
@api_app.post('/predict')
|
152 |
async def predict(data: Predict):
|
|
|
137 |
except Exception as e:
|
138 |
raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
|
139 |
|
140 |
+
@api_app.get("/api/delete_source")
|
141 |
def delete_source_route():
|
142 |
folder_name = "SOURCE_DOCUMENTS"
|
143 |
|
|
|
146 |
|
147 |
os.makedirs(folder_name)
|
148 |
|
149 |
+
return {"message": f"Folder '{folder_name}' successfully deleted and recreated."}
|
150 |
|
151 |
@api_app.post('/predict')
|
152 |
async def predict(data: Predict):
|