Spaces:
Running
Running
Prompt limit to 512
Browse files- Dockerfile +1 -7
- app/rag.py +1 -1
- start_service.sh +0 -3
Dockerfile
CHANGED
@@ -16,9 +16,6 @@ COPY ./start_service.sh /code/start_service.sh
|
|
16 |
#
|
17 |
COPY ./app /code/app
|
18 |
|
19 |
-
#
|
20 |
-
# RUN apt-get update && apt-get install -y sudo
|
21 |
-
|
22 |
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
|
23 |
|
24 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
@@ -34,7 +31,4 @@ RUN nohup ollama serve & sleep 5
|
|
34 |
EXPOSE 7860
|
35 |
|
36 |
# # Run .sh file
|
37 |
-
ENTRYPOINT ["sh", "/code/start_service.sh"]
|
38 |
-
|
39 |
-
#
|
40 |
-
# CMD ["fastapi", "run", "app/main.py", "--port", "80"]
|
|
|
16 |
#
|
17 |
COPY ./app /code/app
|
18 |
|
|
|
|
|
|
|
19 |
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
|
20 |
|
21 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
|
|
31 |
EXPOSE 7860
|
32 |
|
33 |
# # Run .sh file
|
34 |
+
ENTRYPOINT ["sh", "/code/start_service.sh"]
|
|
|
|
|
|
app/rag.py
CHANGED
@@ -52,7 +52,7 @@ class ChatPDF:
|
|
52 |
if not self.chain:
|
53 |
return "Please, add a PDF document first."
|
54 |
|
55 |
-
return self.chain.invoke(query)
|
56 |
|
57 |
def clear(self):
|
58 |
self.vector_store = None
|
|
|
52 |
if not self.chain:
|
53 |
return "Please, add a PDF document first."
|
54 |
|
55 |
+
return self.chain.invoke(query[:512])
|
56 |
|
57 |
def clear(self):
|
58 |
self.vector_store = None
|
start_service.sh
CHANGED
@@ -1,8 +1,5 @@
|
|
1 |
#!/bin/sh
|
2 |
|
3 |
-
#
|
4 |
-
# curl -fsSL https://ollama.com/install.sh | sh
|
5 |
-
|
6 |
# Start Ollama in the background
|
7 |
ollama serve &
|
8 |
|
|
|
1 |
#!/bin/sh
|
2 |
|
|
|
|
|
|
|
3 |
# Start Ollama in the background
|
4 |
ollama serve &
|
5 |
|