Spaces:
Running
Running
fix
Browse files- Dockerfile +0 -2
- app/main.py +2 -1
Dockerfile
CHANGED
@@ -22,8 +22,6 @@ RUN curl -fsSL https://ollama.com/install.sh | sh
|
|
22 |
|
23 |
USER docker
|
24 |
|
25 |
-
RUN mkdir ~/wtp_be_files/
|
26 |
-
|
27 |
RUN nohup ollama serve & sleep 5
|
28 |
|
29 |
#
|
|
|
22 |
|
23 |
USER docker
|
24 |
|
|
|
|
|
25 |
RUN nohup ollama serve & sleep 5
|
26 |
|
27 |
#
|
app/main.py
CHANGED
@@ -39,6 +39,7 @@ def upload(files: list[UploadFile]):
|
|
39 |
session_messages = []
|
40 |
|
41 |
try:
|
|
|
42 |
for file in files:
|
43 |
try:
|
44 |
file.file.seek(0)
|
@@ -48,7 +49,7 @@ def upload(files: list[UploadFile]):
|
|
48 |
file.file.close()
|
49 |
finally:
|
50 |
session_assistant.ingest("~/wtp_be_files/")
|
51 |
-
|
52 |
|
53 |
return "Files inserted!"
|
54 |
|
|
|
39 |
session_messages = []
|
40 |
|
41 |
try:
|
42 |
+
os.mkdir("~/wtp_be_files/")
|
43 |
for file in files:
|
44 |
try:
|
45 |
file.file.seek(0)
|
|
|
49 |
file.file.close()
|
50 |
finally:
|
51 |
session_assistant.ingest("~/wtp_be_files/")
|
52 |
+
shutil.rmtree("~/wtp_be_files/")
|
53 |
|
54 |
return "Files inserted!"
|
55 |
|