Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c68bb3b9
Commit
c68bb3b9
authored
Jan 07, 2024
by
Timothy J. Baek
Browse files
docker: slim
parent
31bd6dfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Dockerfile
Dockerfile
+2
-2
backend/apps/rag/main.py
backend/apps/rag/main.py
+4
-4
No files found.
Dockerfile
View file @
c68bb3b9
...
@@ -10,7 +10,7 @@ RUN npm ci
...
@@ -10,7 +10,7 @@ RUN npm ci
COPY
. .
COPY
. .
RUN
npm run build
RUN
npm run build
FROM
python:3.11-bookworm as base
FROM
python:3.11-
slim-
bookworm as base
ENV
ENV=prod
ENV
ENV=prod
...
@@ -28,7 +28,7 @@ WORKDIR /app/backend
...
@@ -28,7 +28,7 @@ WORKDIR /app/backend
COPY
./backend/requirements.txt ./requirements.txt
COPY
./backend/requirements.txt ./requirements.txt
RUN
pip3
install
-r
requirements.txt
RUN
pip3
install
-r
requirements.txt
RUN
python
-c
"from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')"
#
RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')"
COPY
./backend .
COPY
./backend .
...
...
backend/apps/rag/main.py
View file @
c68bb3b9
...
@@ -11,7 +11,7 @@ from fastapi import (
...
@@ -11,7 +11,7 @@ from fastapi import (
from
fastapi.middleware.cors
import
CORSMiddleware
from
fastapi.middleware.cors
import
CORSMiddleware
import
os
,
shutil
import
os
,
shutil
from
chromadb.utils
import
embedding_functions
#
from chromadb.utils import embedding_functions
from
langchain_community.document_loaders
import
WebBaseLoader
,
TextLoader
,
PyPDFLoader
from
langchain_community.document_loaders
import
WebBaseLoader
,
TextLoader
,
PyPDFLoader
from
langchain.text_splitter
import
RecursiveCharacterTextSplitter
from
langchain.text_splitter
import
RecursiveCharacterTextSplitter
...
@@ -29,9 +29,9 @@ from utils.utils import get_current_user
...
@@ -29,9 +29,9 @@ from utils.utils import get_current_user
from
config
import
UPLOAD_DIR
,
EMBED_MODEL
,
CHROMA_CLIENT
,
CHUNK_SIZE
,
CHUNK_OVERLAP
from
config
import
UPLOAD_DIR
,
EMBED_MODEL
,
CHROMA_CLIENT
,
CHUNK_SIZE
,
CHUNK_OVERLAP
from
constants
import
ERROR_MESSAGES
from
constants
import
ERROR_MESSAGES
EMBEDDING_FUNC
=
embedding_functions
.
SentenceTransformerEmbeddingFunction
(
#
EMBEDDING_FUNC = embedding_functions.SentenceTransformerEmbeddingFunction(
model_name
=
EMBED_MODEL
#
model_name=EMBED_MODEL
)
#
)
app
=
FastAPI
()
app
=
FastAPI
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment