Spaces:
Running
Running
Update main.py
Browse files- app/main.py +3 -2
app/main.py
CHANGED
@@ -58,10 +58,11 @@ async def parse_body(request: Request):
|
|
58 |
return data
|
59 |
|
60 |
@app.post("/upload")
|
61 |
-
def upload(data: bytes = Depends(parse_body)):
|
|
|
62 |
if data:
|
63 |
try:
|
64 |
-
path = f"{files_dir}/
|
65 |
with open(path, "wb") as f:
|
66 |
f.write(data)
|
67 |
session_assistant.ingest(files_dir)
|
|
|
58 |
return data
|
59 |
|
60 |
@app.post("/upload")
|
61 |
+
def upload(filename: str, data: bytes = Depends(parse_body)):
|
62 |
+
print("Filename: " + filename)
|
63 |
if data:
|
64 |
try:
|
65 |
+
path = f"{files_dir}/{filename}"
|
66 |
with open(path, "wb") as f:
|
67 |
f.write(data)
|
68 |
session_assistant.ingest(files_dir)
|