Skip to content

Commit

Permalink
version 0.3.35
Browse files Browse the repository at this point in the history
  • Loading branch information
oznav2 committed Oct 28, 2024
1 parent 0cbe247 commit 089cfe8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
9 changes: 7 additions & 2 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ENV APP_BUILD_HASH=${BUILD_HASH}
RUN npm run build

######## WebUI backend ########
FROM python:3.11-slim-bookworm as base
FROM python:3.11-slim-bookworm AS base

# Use args
ARG USE_CUDA
Expand Down Expand Up @@ -187,7 +187,7 @@ RUN pip3 install uv && \
echo "========Installing CUDA version======" && \
pip3 install torch torchvision torchaudio --no-cache-dir && \
# Install requirements.txt
uv pip install -r requirements.txt --no-cache-dir && \
pip3 install -r requirements.txt --no-cache-dir && \
# Verify imports and model loading
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
Expand Down Expand Up @@ -215,6 +215,11 @@ COPY --chown=$UID:$GID --from=build /app/package.json /app/package.json
# Copy backend files
COPY --chown=$UID:$GID ./backend .

# provide group with same permissions as user
# allows running in OpenShift
RUN chmod -R g=u /app $HOME


EXPOSE 8080

HEALTHCHECK CMD curl --silent --fail http://localhost:${PORT:-8080}/health | jq -ne 'input.status == true' || exit 1
Expand Down
36 changes: 18 additions & 18 deletions backend/open_webui/apps/retrieval/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,37 +175,37 @@
app.state.config.RAG_WEB_SEARCH_CONCURRENT_REQUESTS = RAG_WEB_SEARCH_CONCURRENT_REQUESTS


# def update_embedding_model(
# embedding_model: str,
# auto_update: bool = False,
# ):
# if embedding_model and app.state.config.RAG_EMBEDDING_ENGINE == "":
# from sentence_transformers import SentenceTransformer

# app.state.sentence_transformer_ef = SentenceTransformer(
# get_model_path(embedding_model, auto_update),
# device=DEVICE_TYPE,
# trust_remote_code=RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE,
# )
# else:
# app.state.sentence_transformer_ef = None

# reverting to old version of this function
def update_embedding_model(
embedding_model: str,
auto_update: bool = False,
):
if embedding_model and app.state.config.RAG_EMBEDDING_ENGINE == "":
import sentence_transformers
from sentence_transformers import SentenceTransformer

app.state.sentence_transformer_ef = sentence_transformers.SentenceTransformer(
app.state.sentence_transformer_ef = SentenceTransformer(
get_model_path(embedding_model, auto_update),
device=DEVICE_TYPE,
trust_remote_code=RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE,
)
else:
app.state.sentence_transformer_ef = None

# reverting to old version of this function
# def update_embedding_model(
# embedding_model: str,
# auto_update: bool = False,
# ):
# if embedding_model and app.state.config.RAG_EMBEDDING_ENGINE == "":
# import sentence_transformers

# app.state.sentence_transformer_ef = sentence_transformers.SentenceTransformer(
# get_model_path(embedding_model, auto_update),
# device=DEVICE_TYPE,
# trust_remote_code=RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE,
# )
# else:
# app.state.sentence_transformer_ef = None

def update_reranking_model(
reranking_model: str,
auto_update: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-myCustomizations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
- OPENAI_API_BASE_URL=http://pipelines:9099
- OPENAI_API_KEY=0p3n-w3bu!
- TIKTOKEN_ENCODING_NAME=cl100k_base
- RAG_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
- RAG_EMBEDDING_MODEL=intfloat/multilingual-e5-large
- WHISPER_MODEL=ivrit-ai/faster-whisper-v2-d3-e3
- WHISPER_MODEL_DIR=/app/backend/data/cache/whisper/models
- SENTENCE_TRANSFORMERS_HOME=/app/backend/data/cache/embedding/models
Expand Down

0 comments on commit 089cfe8

Please sign in to comment.