Spaces:
Running
Running
fix upload storage
Browse files- Dockerfile +2 -0
- app/main.py +3 -3
Dockerfile
CHANGED
@@ -22,6 +22,8 @@ RUN curl -fsSL https://ollama.com/install.sh | sh
|
|
22 |
|
23 |
USER docker
|
24 |
|
|
|
|
|
25 |
RUN nohup ollama serve & sleep 5
|
26 |
|
27 |
#
|
|
|
22 |
|
23 |
USER docker
|
24 |
|
25 |
+
RUN mkdir ~/wtp_be_files/
|
26 |
+
|
27 |
RUN nohup ollama serve & sleep 5
|
28 |
|
29 |
#
|
app/main.py
CHANGED
@@ -42,13 +42,13 @@ def upload(files: list[UploadFile]):
|
|
42 |
for file in files:
|
43 |
try:
|
44 |
file.file.seek(0)
|
45 |
-
with Path("
|
46 |
shutil.copyfileobj(file.file, destination)
|
47 |
finally:
|
48 |
file.file.close()
|
49 |
finally:
|
50 |
-
session_assistant.ingest("
|
51 |
-
os.remove("
|
52 |
|
53 |
return "Files inserted!"
|
54 |
|
|
|
42 |
for file in files:
|
43 |
try:
|
44 |
file.file.seek(0)
|
45 |
+
with Path("~/wtp_be_files/").open("wb") as destination:
|
46 |
shutil.copyfileobj(file.file, destination)
|
47 |
finally:
|
48 |
file.file.close()
|
49 |
finally:
|
50 |
+
session_assistant.ingest("~/wtp_be_files/")
|
51 |
+
os.remove("~/wtp_be_files/")
|
52 |
|
53 |
return "Files inserted!"
|
54 |
|