Skip to content

Commit a01729a

Browse files
Refactor DocSum example (#1286)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6b6a08d commit a01729a

File tree

16 files changed

+145
-1143
lines changed

16 files changed

+145
-1143
lines changed

DocSum/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ FROM python:3.11-slim
66
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
77
libgl1-mesa-glx \
88
libjemalloc-dev \
9-
git
9+
git \
10+
ffmpeg
1011

1112
RUN useradd -m -s /bin/bash user && \
1213
mkdir -p /home/user && \

DocSum/docker_compose/amd/gpu/rocm/compose.yaml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,6 @@ services:
7070
https_proxy: ${https_proxy}
7171
restart: unless-stopped
7272

73-
dataprep-audio2text:
74-
image: ${REGISTRY:-opea}/dataprep-audio2text:${TAG:-latest}
75-
container_name: dataprep-audio2text-service
76-
ports:
77-
- "9099:9099"
78-
ipc: host
79-
environment:
80-
A2T_ENDPOINT: ${A2T_ENDPOINT}
81-
82-
dataprep-video2audio:
83-
image: ${REGISTRY:-opea}/dataprep-video2audio:${TAG:-latest}
84-
container_name: dataprep-video2audio-service
85-
ports:
86-
- "7078:7078"
87-
ipc: host
88-
environment:
89-
V2A_ENDPOINT: ${V2A_ENDPOINT}
90-
91-
dataprep-multimedia2text:
92-
image: ${REGISTRY:-opea}/dataprep-multimedia2text:${TAG:-latest}
93-
container_name: dataprep-multimedia2text
94-
ports:
95-
- "7079:7079"
96-
ipc: host
97-
environment:
98-
V2A_ENDPOINT: ${V2A_ENDPOINT}
99-
A2T_ENDPOINT: ${A2T_ENDPOINT}
100-
10173
docsum-backend-server:
10274
image: ${REGISTRY:-opea}/docsum:${TAG:-latest}
10375
container_name: docsum-backend-server
@@ -111,8 +83,9 @@ services:
11183
- https_proxy=${https_proxy}
11284
- http_proxy=${http_proxy}
11385
- MEGA_SERVICE_HOST_IP=${HOST_IP}
114-
- DATA_SERVICE_HOST_IP=${DATA_SERVICE_HOST_IP}
11586
- LLM_SERVICE_HOST_IP=${HOST_IP}
87+
- ASR_SERVICE_HOST_IP=${ASR_SERVICE_HOST_IP}
88+
11689
ipc: host
11790
restart: always
11891

DocSum/docker_compose/amd/gpu/rocm/set_env.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,3 @@ export DOCSUM_LLM_SERVER_PORT="9000"
1515
export DOCSUM_BACKEND_SERVER_PORT="8888"
1616
export DOCSUM_FRONTEND_PORT="5173"
1717
export BACKEND_SERVICE_ENDPOINT="http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
18-
export V2A_SERVICE_HOST_IP=${host_ip}
19-
export V2A_ENDPOINT=http://$host_ip:7078
20-
export A2T_ENDPOINT=http://$host_ip:7066
21-
export A2T_SERVICE_HOST_IP=${host_ip}
22-
export A2T_SERVICE_PORT=9099
23-
export DATA_ENDPOINT=http://$host_ip:7079
24-
export DATA_SERVICE_HOST_IP=${host_ip}
25-
export DATA_SERVICE_PORT=7079

DocSum/docker_compose/intel/cpu/xeon/README.md

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,6 @@ The Whisper Service converts audio files to text. Follow these steps to build an
2929
docker build -t opea/whisper:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/dependency/Dockerfile .
3030
```
3131

32-
#### Audio to text Service
33-
34-
The Audio to text Service is another service for converting audio to text. Follow these steps to build and run the service:
35-
36-
```bash
37-
docker build -t opea/dataprep-audio2text:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/audio2text/Dockerfile .
38-
```
39-
40-
#### Video to Audio Service
41-
42-
The Video to Audio Service extracts audio from video files. Follow these steps to build and run the service:
43-
44-
```bash
45-
docker build -t opea/dataprep-video2audio:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/video2audio/Dockerfile .
46-
```
47-
48-
#### Multimedia to Text Service
49-
50-
The Multimedia to Text Service transforms multimedia data to text data. Follow these steps to build and run the service:
51-
52-
```bash
53-
docker build -t opea/dataprep-multimedia2text:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/Dockerfile .
54-
```
55-
5632
### 2. Build MegaService Docker Image
5733

5834
To construct the Mega Service, we utilize the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline within the `docsum.py` Python script. Build the MegaService Docker image via below command:
@@ -149,9 +125,6 @@ You will have the following Docker Images:
149125
2. `opea/docsum:latest`
150126
3. `opea/llm-docsum-tgi:latest`
151127
4. `opea/whisper:latest`
152-
5. `opea/dataprep-audio2text:latest`
153-
6. `opea/dataprep-multimedia2text:latest`
154-
7. `opea/dataprep-video2audio:latest`
155128

156129
### Validate Microservices
157130

@@ -188,37 +161,7 @@ You will have the following Docker Images:
188161
{"asr_result":"you"}
189162
```
190163

191-
4. Audio2Text Microservice
192-
193-
```bash
194-
curl http://${host_ip}:9099/v1/audio/transcriptions \
195-
-X POST \
196-
-d '{"byte_str":"UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
197-
-H 'Content-Type: application/json'
198-
```
199-
200-
Expected output:
201-
202-
```bash
203-
{"downstream_black_list":[],"id":"--> this will be different id number for each run <--","query":"you"}
204-
```
205-
206-
5. Multimedia to text Microservice
207-
208-
```bash
209-
curl http://${host_ip}:7079/v1/multimedia2text \
210-
-X POST \
211-
-d '{"audio":"UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
212-
-H 'Content-Type: application/json'
213-
```
214-
215-
Expected output:
216-
217-
```bash
218-
{"downstream_black_list":[],"id":"--> this will be different id number for each run <--","query":"you"}
219-
```
220-
221-
6. MegaService
164+
4. MegaService
222165

223166
Text:
224167

@@ -257,7 +200,7 @@ You will have the following Docker Images:
257200
-F "stream=true"
258201
```
259202

260-
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI.
203+
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI. You can still pass base64 string of the audio or video file as follows:
261204
262205
Audio:
263206

@@ -291,7 +234,7 @@ You will have the following Docker Images:
291234
-F "stream=true"
292235
```
293236

294-
7. MegaService with long context
237+
5. MegaService with long context
295238

296239
If you want to deal with long context, can set following parameters and select suitable summary type.
297240

DocSum/docker_compose/intel/cpu/xeon/compose.yaml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,21 @@ services:
5050
https_proxy: ${https_proxy}
5151
restart: unless-stopped
5252

53-
dataprep-audio2text:
54-
image: ${REGISTRY:-opea}/dataprep-audio2text:${TAG:-latest}
55-
container_name: dataprep-audio2text-server
56-
ports:
57-
- "9099:9099"
58-
ipc: host
59-
environment:
60-
A2T_ENDPOINT: ${A2T_ENDPOINT}
61-
62-
dataprep-video2audio:
63-
image: ${REGISTRY:-opea}/dataprep-video2audio:${TAG:-latest}
64-
container_name: dataprep-video2audio-server
65-
ports:
66-
- "7078:7078"
67-
ipc: host
68-
environment:
69-
V2A_ENDPOINT: ${V2A_ENDPOINT}
70-
71-
dataprep-multimedia2text:
72-
image: ${REGISTRY:-opea}/dataprep-multimedia2text:${TAG:-latest}
73-
container_name: dataprep-multimedia2text
74-
ports:
75-
- "7079:7079"
76-
ipc: host
77-
environment:
78-
V2A_ENDPOINT: ${V2A_ENDPOINT}
79-
A2T_ENDPOINT: ${A2T_ENDPOINT}
80-
8153
docsum-xeon-backend-server:
8254
image: ${REGISTRY:-opea}/docsum:${TAG:-latest}
8355
container_name: docsum-xeon-backend-server
8456
depends_on:
8557
- tgi-server
8658
- llm-docsum-tgi
87-
- dataprep-multimedia2text
88-
- dataprep-video2audio
89-
- dataprep-audio2text
9059
ports:
9160
- "8888:8888"
9261
environment:
9362
- no_proxy=${no_proxy}
9463
- https_proxy=${https_proxy}
9564
- http_proxy=${http_proxy}
9665
- MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP}
97-
- DATA_SERVICE_HOST_IP=${DATA_SERVICE_HOST_IP}
9866
- LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP}
67+
- ASR_SERVICE_HOST_IP=${ASR_SERVICE_HOST_IP}
9968
ipc: host
10069
restart: always
10170

DocSum/docker_compose/intel/hpu/gaudi/README.md

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,12 @@ git clone https://github.com/opea-project/GenAIComps.git
1313
cd GenAIComps
1414
```
1515

16-
#### Audio to text Service
16+
#### Whisper Service
1717

18-
The Audio to text Service is another service for converting audio to text. Follow these steps to build and run the service:
18+
The Whisper Service converts audio files to text. Follow these steps to build and run the service:
1919

2020
```bash
21-
docker build -t opea/dataprep-audio2text:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/audio2text/Dockerfile .
22-
```
23-
24-
#### Video to Audio Service
25-
26-
The Video to Audio Service extracts audio from video files. Follow these steps to build and run the service:
27-
28-
```bash
29-
docker build -t opea/dataprep-video2audio:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/video2audio/Dockerfile .
30-
```
31-
32-
#### Multimedia to Text Service
33-
34-
The Multimedia to Text Service transforms multimedia data to text data. Follow these steps to build and run the service:
35-
36-
```bash
37-
docker build -t opea/dataprep-multimedia2text:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/dataprep/multimedia2text/Dockerfile .
21+
docker build -t opea/whisper:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/dependency/Dockerfile .
3822
```
3923

4024
### 2. Build MegaService Docker Image
@@ -133,9 +117,6 @@ You will have the following Docker Images:
133117
2. `opea/docsum:latest`
134118
3. `opea/llm-docsum-tgi:latest`
135119
4. `opea/whisper:latest`
136-
5. `opea/dataprep-audio2text:latest`
137-
6. `opea/dataprep-multimedia2text:latest`
138-
7. `opea/dataprep-video2audio:latest`
139120

140121
### Validate Microservices
141122

@@ -172,37 +153,7 @@ You will have the following Docker Images:
172153
{"asr_result":"you"}
173154
```
174155

175-
4. Audio2Text Microservice
176-
177-
```bash
178-
curl http://${host_ip}:9199/v1/audio/transcriptions \
179-
-X POST \
180-
-d '{"byte_str":"UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
181-
-H 'Content-Type: application/json'
182-
```
183-
184-
Expected output:
185-
186-
```bash
187-
{"downstream_black_list":[],"id":"--> this will be different id number for each run <--","query":"you"}
188-
```
189-
190-
5. Multimedia to text Microservice
191-
192-
```bash
193-
curl http://${host_ip}:7079/v1/multimedia2text \
194-
-X POST \
195-
-d '{"audio":"UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
196-
-H 'Content-Type: application/json'
197-
```
198-
199-
Expected output:
200-
201-
```bash
202-
{"downstream_black_list":[],"id":"--> this will be different id number for each run <--","query":"you"}
203-
```
204-
205-
6. MegaService
156+
4. MegaService
206157

207158
Text:
208159

@@ -274,7 +225,7 @@ You will have the following Docker Images:
274225
-F "stream=True"
275226
```
276227

277-
7. MegaService with long context
228+
5. MegaService with long context
278229

279230
If you want to deal with long context, can set following parameters and select suitable summary type.
280231

DocSum/docker_compose/intel/hpu/gaudi/compose.yaml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,52 +62,21 @@ services:
6262
- SYS_NICE
6363
restart: unless-stopped
6464

65-
dataprep-audio2text:
66-
image: ${REGISTRY:-opea}/dataprep-audio2text:${TAG:-latest}
67-
container_name: dataprep-audio2text-server
68-
ports:
69-
- "9199:9099"
70-
ipc: host
71-
environment:
72-
A2T_ENDPOINT: ${A2T_ENDPOINT}
73-
74-
dataprep-video2audio:
75-
image: ${REGISTRY:-opea}/dataprep-video2audio:${TAG:-latest}
76-
container_name: dataprep-video2audio-server
77-
ports:
78-
- "7078:7078"
79-
ipc: host
80-
environment:
81-
V2A_ENDPOINT: ${V2A_ENDPOINT}
82-
83-
dataprep-multimedia2text:
84-
image: ${REGISTRY:-opea}/dataprep-multimedia2text:${TAG:-latest}
85-
container_name: dataprep-multimedia2text
86-
ports:
87-
- "7079:7079"
88-
ipc: host
89-
environment:
90-
V2A_ENDPOINT: ${V2A_ENDPOINT}
91-
A2T_ENDPOINT: ${A2T_ENDPOINT}
92-
9365
docsum-gaudi-backend-server:
9466
image: ${REGISTRY:-opea}/docsum:${TAG:-latest}
9567
container_name: docsum-gaudi-backend-server
9668
depends_on:
9769
- tgi-server
9870
- llm-docsum-tgi
99-
- dataprep-multimedia2text
100-
- dataprep-video2audio
101-
- dataprep-audio2text
10271
ports:
10372
- "8888:8888"
10473
environment:
10574
- no_proxy=${no_proxy}
10675
- https_proxy=${https_proxy}
10776
- http_proxy=${http_proxy}
10877
- MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP}
109-
- DATA_SERVICE_HOST_IP=${DATA_SERVICE_HOST_IP}
11078
- LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP}
79+
- ASR_SERVICE_HOST_IP=${ASR_SERVICE_HOST_IP}
11180

11281
ipc: host
11382
restart: always

DocSum/docker_compose/set_env.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ export no_proxy="${no_proxy},${host_ip}"
1313
export TGI_LLM_ENDPOINT="http://${host_ip}:8008"
1414
export MEGA_SERVICE_HOST_IP=${host_ip}
1515
export LLM_SERVICE_HOST_IP=${host_ip}
16-
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/docsum"
17-
18-
export V2A_SERVICE_HOST_IP=${host_ip}
19-
export V2A_ENDPOINT=http://$host_ip:7078
16+
export ASR_SERVICE_HOST_IP=${host_ip}
17+
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
2018

21-
export A2T_ENDPOINT=http://$host_ip:7066
22-
export A2T_SERVICE_HOST_IP=${host_ip}
23-
export A2T_SERVICE_PORT=9099
24-
25-
export DATA_ENDPOINT=http://$host_ip:7079
26-
export DATA_SERVICE_HOST_IP=${host_ip}
27-
export DATA_SERVICE_PORT=7079
19+
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/docsum"

0 commit comments

Comments
 (0)