Skip to content

Commit 3d52e4d

Browse files
authored
Merge pull request #325 from open-edge-platform/update-branch
bug: fix rag toolkit fix vulnerability (#868)
2 parents 3782eeb + 0aa25e7 commit 3d52e4d

File tree

14 files changed

+2093
-2906
lines changed

14 files changed

+2093
-2906
lines changed

usecases/ai/microservices/speech-to-text/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ ENV PATH="/usr/src/.venv/bin:$PATH"
4747

4848
# Install python dependencies
4949
COPY --chown=openvino:openvino requirements.txt .
50-
RUN python3 -m pip install -r requirements.txt
50+
RUN python3 -m pip install -U pip \
51+
&& python3 -m pip install -r requirements.txt
5152

5253
COPY --chown=openvino:openvino main.py .
5354
COPY --chown=openvino:openvino utils.py .

usecases/ai/microservices/text-to-speech/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ RUN mkdir -p /usr/src/app/data/models \
5454
# Install Melo TTS
5555
COPY requirements.txt .
5656
RUN python3 -m pip install --upgrade pip \
57-
&& python3 -m pip install git+https://github.com/zhaohb/MeloTTS-OV.git@1962eee \
57+
&& python3 -m pip install git+https://github.com/zhaohb/MeloTTS-OV.git@1962eee --extra-index-url https://download.pytorch.org/whl/cpu \
5858
&& python3 -m pip install -r requirements.txt \
5959
&& python3 -m unidic download
6060

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
fastapi[all]
22
uvicorn
33
pydantic<2
4+
soxr
45

56
--extra-index-url https://download.pytorch.org/whl/cpu
6-
optimum-intel[openvino,nncf]==1.21.0
7-
openvino==2024.6.0
7+
torch==2.8.0
8+
torchaudio==2.8.0
9+
optimum-intel[openvino,nncf]==1.26.1
10+
openvino==2025.3.0
811
transformers

usecases/ai/rag-toolkit/backend/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
FROM debian:12-slim
55
ARG DEBIAN_FRONTEND=noninteractive
6-
ARG OPENVINO_VERSION=2025.1.0
6+
ARG OPENVINO_VERSION=2025.3.0
77
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
88

99
USER root
@@ -58,7 +58,7 @@ RUN python3 -m venv /usr/src/.venv
5858
ENV PATH="/usr/src/.venv/bin:$PATH"
5959

6060
# Install python dependencies
61-
RUN python3 -m pip install fastapi[all]==0.111.0 \
61+
RUN python3 -m pip install fastapi[all] \
6262
sse_starlette==2.1.2 \
6363
scipy \
6464
soundfile \
@@ -75,10 +75,10 @@ RUN python3 -m pip install fastapi[all]==0.111.0 \
7575
cached_path==1.6.3 \
7676
python-magic
7777
RUN python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cpu \
78-
'torch>=2.6.0' \
79-
'torchaudio>=2.6.0' \
80-
openvino==2025.1.0 \
81-
optimum-intel[openvino,nncf]==1.22.0
78+
torch==2.8.0 \
79+
torchaudio==2.8.0 \
80+
openvino==2025.3.0 \
81+
optimum-intel[openvino,nncf]==1.26.1
8282

8383
COPY --chown=openvino:openvino backend .
8484

usecases/ai/rag-toolkit/backend/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ def _formatting_rag_fusion_result(retrieval_list, query):
294294
if 'rag' in data:
295295
data.pop('rag')
296296

297+
if 'max_tokens' in data:
298+
data['max_completion_tokens'] = data.pop('max_tokens')
299+
300+
print(f"Data: {data}")
297301
try:
298302
llm = requests.post(
299303
endpoint,

usecases/ai/rag-toolkit/docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
networks:
1616
- app-network
1717
ports:
18-
- "127.0.0.1:8010:3000"
18+
- "${HOST:-127.0.0.1}:8010:3000"
1919

2020
backend:
2121
build:
@@ -31,10 +31,10 @@ services:
3131
networks:
3232
- app-network
3333
ports:
34-
- "127.0.0.1:8011:8011"
34+
- "${HOST:-127.0.0.1}:8011:8011"
3535
environment:
3636
- OPENAI_BASE_URL=http://serving:8000/v1
37-
- ALLOWED_CORS=["http://localhost:8010"]
37+
- ALLOWED_CORS=["http://localhost:8010","http://localhost:3000"]
3838
- EMBEDDING_DEVICE=${EMBEDDING_DEVICE:-CPU}
3939
- RERANKER_DEVICE=${RERANKER_DEVICE:-CPU}
4040
depends_on:
@@ -61,7 +61,7 @@ services:
6161
networks:
6262
- app-network
6363
ports:
64-
- "127.0.0.1:8012:8000"
64+
- "${HOST:-127.0.0.1}:8012:8000"
6565
environment:
6666
- DEFAULT_MODEL_ID=Qwen/Qwen2.5-7B-Instruct
6767
- MODEL_PATH=./data/models/llm
@@ -92,7 +92,7 @@ services:
9292
- BERT_DEVICE=${BERT_DEVICE:-CPU}
9393
- ALLOWED_CORS=["*"]
9494
ports:
95-
- 127.0.0.1:8013:5995
95+
- ${HOST:-127.0.0.1}:8013:5995
9696
devices:
9797
- /dev/dri:/dev/dri
9898
volumes:
@@ -110,11 +110,11 @@ services:
110110
networks:
111111
- app-network
112112
environment:
113-
- DEFAULT_MODEL_ID=openai/whisper-tiny
113+
- DEFAULT_MODEL_ID=openai/whisper-base
114114
- STT_DEVICE=CPU
115115
- ALLOWED_CORS=["*"]
116116
ports:
117-
- 127.0.0.1:8014:5996
117+
- ${HOST:-127.0.0.1}:8014:5996
118118
devices:
119119
- /dev/dri:/dev/dri
120120
volumes:

0 commit comments

Comments
 (0)