@@ -17,7 +17,7 @@ Port 8001 - Open to 0.0.0.0/0
17
17
18
18
embedding
19
19
=========
20
- Port 6000 - Open to 0.0.0.0/0
20
+ Port 6990 - Open to 0.0.0.0/0
21
21
22
22
retriever
23
23
=========
@@ -33,13 +33,13 @@ Port 9009 - Open to 0.0.0.0/0
33
33
34
34
lvm
35
35
===
36
- Port 9000 - Open to 0.0.0.0/0
36
+ Port 9399 - Open to 0.0.0.0/0
37
37
38
- chaqna -xeon-backend-server
38
+ videoqna -xeon-backend-server
39
39
==========================
40
40
Port 8888 - Open to 0.0.0.0/0
41
41
42
- chaqna -xeon-ui-server
42
+ videoqna -xeon-ui-server
43
43
=====================
44
44
Port 5173 - Open to 0.0.0.0/0
45
45
```
@@ -106,17 +106,14 @@ docker build -t opea/videoqna-ui:latest --build-arg https_proxy=$https_proxy --b
106
106
107
107
Then run the command ` docker images ` , you will have the following 8 Docker Images:
108
108
109
+ 1 . ` opea/embedding-multimodal-clip:latest `
110
+ 1 . ` opea/retriever:latest `
111
+ 1 . ` opea/reranking:latest `
112
+ 1 . ` opea/lvm-video-llama:latest `
113
+ 1 . ` opea/lvm:latest `
109
114
1 . ` opea/dataprep:latest `
110
- 2 . ` opea/embedding-multimodal-clip:latest `
111
- 3 . ` opea/retriever:latest `
112
- 4 . ` opea/reranking:latest `
113
- 5 . ` opea/video-llama-lvm-server:latest `
114
- 6 . # ` opea/lvm-video-llama:latest `
115
- 7 . ` opea/reranking-tei:latest `
116
- 8 . ` opea/lvm-video-llama:latest `
117
- 9 . ` opea/lvm:latest `
118
- 10 . ` opea/videoqna:latest `
119
- 11 . ` opea/videoqna-ui:latest `
115
+ 1 . ` opea/videoqna:latest `
116
+ 1 . ` opea/videoqna-ui:latest `
120
117
121
118
## 🚀 Start Microservices
122
119
@@ -132,18 +129,18 @@ Since the `compose.yaml` will consume some environment variables, you need to se
132
129
export host_ip="External_Public_IP"
133
130
```
134
131
135
- ** Export the value of your Huggingface API token to the ` your_hf_api_token ` environment variable**
132
+ ** Export the value of your Huggingface API token to the ` HF_TOKEN ` environment variable**
136
133
137
134
> Change the ` Your_Huggingface_API_Token ` below with your actual Huggingface API Token value
138
135
139
136
```
140
- export your_hf_api_token ="Your_Huggingface_API_Token"
137
+ export HF_TOKEN ="Your_Huggingface_API_Token"
141
138
```
142
139
143
140
** Append the value of the public IP address to the no_proxy list**
144
141
145
142
```
146
- export your_no_proxy ="${your_no_proxy},${host_ip}"
143
+ export no_proxy ="${your_no_proxy},${host_ip}"
147
144
```
148
145
149
146
Then you can run below commands or ` source set_env.sh ` to set all the variables
@@ -152,26 +149,52 @@ Then you can run below commands or `source set_env.sh` to set all the variables
152
149
export no_proxy=${your_no_proxy}
153
150
export http_proxy=${your_http_proxy}
154
151
export https_proxy=${your_http_proxy}
155
- export MEGA_SERVICE_HOST_IP=${host_ip}
156
- export EMBEDDING_SERVICE_HOST_IP=${host_ip}
157
- export RETRIEVER_SERVICE_HOST_IP=${host_ip}
158
- export RERANK_SERVICE_HOST_IP=${host_ip}
159
- export LVM_SERVICE_HOST_IP=${host_ip}
160
152
161
- export LVM_ENDPOINT=" http://${host_ip} :9009"
162
- export BACKEND_SERVICE_ENDPOINT=" http://${host_ip} :8888/v1/videoqna"
163
- export BACKEND_HEALTH_CHECK_ENDPOINT=" http://${host_ip} :8888/v1/health_check"
164
- export DATAPREP_SERVICE_ENDPOINT=" http://${host_ip} :6007/v1/dataprep/ingest"
165
- export DATAPREP_GET_FILE_ENDPOINT=" http://${host_ip} :6007/v1/dataprep/get"
166
- export DATAPREP_GET_VIDEO_LIST_ENDPOINT=" http://${host_ip} :6007/v1/dataprep/get_videos"
153
+ export HF_TOKEN=${HF_TOKEN}
154
+ export HUGGINGFACEHUB_API_TOKEN=${HF_TOKEN}
167
155
168
- export VDMS_HOST=${host_ip}
169
- export VDMS_PORT=8001
170
156
export INDEX_NAME=" mega-videoqna"
171
- export LLM_DOWNLOAD=" True"
157
+ export LLM_DOWNLOAD=" True" # Set to "False" before redeploy LVM server to avoid model download
158
+ export RERANK_COMPONENT_NAME=" OPEA_VIDEO_RERANKING"
159
+ export LVM_COMPONENT_NAME=" OPEA_VIDEO_LLAMA_LVM"
160
+ export EMBEDDING_COMPONENT_NAME=" OPEA_CLIP_EMBEDDING"
172
161
export USECLIP=1
162
+ export LOGFLAG=True
173
163
174
- export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
164
+ export EMBEDDING_SERVICE_HOST_IP=${host_ip}
165
+ export LVM_SERVICE_HOST_IP=${host_ip}
166
+ export MEGA_SERVICE_HOST_IP=${host_ip}
167
+ export RERANK_SERVICE_HOST_IP=${host_ip}
168
+ export RETRIEVER_SERVICE_HOST_IP=${host_ip}
169
+ export VDMS_HOST=${host_ip}
170
+
171
+ export BACKEND_PORT=8888
172
+ export DATAPREP_PORT=6007
173
+ export EMBEDDER_PORT=6990
174
+ export MULTIMODAL_CLIP_EMBEDDER_PORT=6991
175
+ export LVM_PORT=9399
176
+ export RERANKING_PORT=8000
177
+ export RETRIEVER_PORT=7000
178
+ export UI_PORT=5173
179
+ export VDMS_PORT=8001
180
+ export VIDEO_LLAMA_PORT=9009
181
+
182
+ export BACKEND_HEALTH_CHECK_ENDPOINT=" http://${host_ip} :${BACKEND_PORT} /v1/health_check"
183
+ export BACKEND_SERVICE_ENDPOINT=" http://${host_ip} :${BACKEND_PORT} /v1/videoqna"
184
+ export CLIP_EMBEDDING_ENDPOINT=" http://${host_ip} :${MULTIMODAL_CLIP_EMBEDDER_PORT} "
185
+ export DATAPREP_GET_FILE_ENDPOINT=" http://${host_ip} :${DATAPREP_PORT} /v1/dataprep/get"
186
+ export DATAPREP_GET_VIDEO_LIST_ENDPOINT=" http://${host_ip} :${DATAPREP_PORT} /v1/dataprep/get_videos"
187
+ export DATAPREP_INGEST_SERVICE_ENDPOINT=" http://${host_ip} :${DATAPREP_PORT} /v1/dataprep/ingest"
188
+ export EMBEDDING_ENDPOINT=" http://${host_ip} :${EMBEDDER_PORT} /v1/embeddings"
189
+ export FRONTEND_ENDPOINT=" http://${host_ip} :${UI_PORT} /_stcore/health"
190
+ export LVM_ENDPOINT=" http://${host_ip} :${VIDEO_LLAMA_PORT} "
191
+ export LVM_VIDEO_ENDPOINT=" http://${host_ip} :${VIDEO_LLAMA_PORT} /generate"
192
+ export RERANKING_ENDPOINT=" http://${host_ip} :${RERANKING_PORT} /v1/reranking"
193
+ export RETRIEVER_ENDPOINT=" http://${host_ip} :${RETRIEVER_PORT} /v1/retrieval"
194
+ export TEI_RERANKING_ENDPOINT=" http://${host_ip} :${TEI_RERANKING_PORT} "
195
+ export UI_ENDPOINT=" http://${host_ip} :${UI_PORT} /_stcore/health"
196
+
197
+ export no_proxy=" ${NO_PROXY} ,${host_ip} ,vdms-vector-db,dataprep-vdms-server,clip-embedding-server,reranking-tei-server,retriever-vdms-server,lvm-video-llama,lvm,videoqna-xeon-backend-server,videoqna-xeon-ui-server"
175
198
```
176
199
177
200
Note: Replace with ` host_ip ` with you external IP address, do not use localhost.
@@ -190,12 +213,13 @@ In the deploy steps, you need to start the VDMS DB and dataprep firstly, then in
190
213
``` bash
191
214
cd GenAIExamples/VideoQnA/docker_compose/intel/cpu/xeon/
192
215
193
- docker volume create video-llama-model
216
+ docker volume create video-llama-
217
+ docker volume create videoqna-cache
194
218
docker compose up vdms-vector-db dataprep -d
195
- sleep 1m # wait for the services ready
219
+ sleep 30s
196
220
197
221
# Insert some sample data to the DB
198
- curl -X POST http:// ${host_ip} :6007/v1/dataprep/ingest \
222
+ curl -X POST ${DATAPREP_INGEST_SERVICE_ENDPOINT} \
199
223
-H " Content-Type: multipart/form-data" \
200
224
-F " files=@./data/op_1_0320241830.mp4"
201
225
@@ -212,11 +236,12 @@ docker compose up -d
212
236
213
237
``` bash
214
238
# Single file upload
215
- curl -X POST ${DATAPREP_SERVICE_ENDPOINT } \
239
+ curl -X POST ${DATAPREP_INGEST_SERVICE_ENDPOINT } \
216
240
-H " Content-Type: multipart/form-data" \
217
241
-F " files=@./file1.mp4"
242
+
218
243
# Multiple file upload
219
- curl -X POST ${DATAPREP_SERVICE_ENDPOINT } \
244
+ curl -X POST ${DATAPREP_INGEST_SERVICE_ENDPOINT } \
220
245
-H " Content-Type: multipart/form-data" \
221
246
-F " files=@./file1.mp4" \
222
247
-F " files=@./file2.mp4" \
@@ -228,16 +253,17 @@ docker compose up -d
228
253
``` bash
229
254
# List available videos
230
255
curl -X ' GET' ${DATAPREP_GET_VIDEO_LIST_ENDPOINT} -H ' accept: application/json'
256
+
231
257
# Download available video
232
258
curl -X ' GET' ${DATAPREP_GET_FILE_ENDPOINT} /video_name.mp4 -H ' accept: application/json'
233
259
```
234
260
235
261
2 . Embedding Microservice
236
262
237
263
``` bash
238
- curl http:// ${host_ip} :6000/v1/embeddings \
264
+ curl ${EMBEDDING_ENDPOINT} \
239
265
-X POST \
240
- -d ' {"text ":"Sample text "}' \
266
+ -d ' {"input ":"What is the man doing? "}' \
241
267
-H ' Content-Type: application/json'
242
268
```
243
269
@@ -251,16 +277,16 @@ docker compose up -d
251
277
252
278
``` bash
253
279
export your_embedding=$( python3 -c " import random; embedding = [random.uniform(-1, 1) for _ in range(512)]; print(embedding)" )
254
- curl http:// ${host_ip} :7000/v1/retrieval \
280
+ curl ${RETRIEVER_ENDPOINT} \
255
281
-X POST \
256
- -d " {\" text\" :\" test \" ,\" embedding\" :${your_embedding} }" \
282
+ -d " {\" text\" :\" What is the man doing? \" ,\" embedding\" :${your_embedding} , \" search_type \" : \" mmr \" , \" k \" :4 }" \
257
283
-H ' Content-Type: application/json'
258
284
```
259
285
260
286
4 . Reranking Microservice
261
287
262
288
``` bash
263
- curl http:// ${host_ip} :8000/v1/reranking \
289
+ curl ${RERANKING_ENDPOINT} \
264
290
-X ' POST' \
265
291
-H ' accept: application/json' \
266
292
-H ' Content-Type: application/json' \
@@ -282,7 +308,7 @@ docker compose up -d
282
308
283
309
``` bash
284
310
curl -X POST \
285
- " http:// ${host_ip} :9009/generate ?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150" \
311
+ " ${LVM_VIDEO_ENDPOINT} ?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150" \
286
312
-H " accept: */*" \
287
313
-d ' '
288
314
```
@@ -294,9 +320,9 @@ docker compose up -d
294
320
This service depends on above LLM backend service startup. It will be ready after long time, to wait for them being ready in first startup.
295
321
296
322
``` bash
297
- curl http://${host_ip} :9000 /v1/lvm\
323
+ curl http://${host_ip} :${LVM_PORT} /v1/lvm \
298
324
-X POST \
299
- -d ' {"video_url":"https://github.com/DAMO-NLP-SG/Video-LLaMA/raw/main/examples/silence_girl.mp4","chunk_start": 0,"chunk_duration": 7,"prompt":"What is the person doing?","max_new_tokens": 50}' \
325
+ -d ' {"video_url":"https://github.com/DAMO-NLP-SG/Video-LLaMA/raw/main/examples/silence_girl.mp4","chunk_start": 0,"chunk_duration": 7,"prompt":"What is the man doing?","max_new_tokens": 50}' \
300
326
-H ' Content-Type: application/json'
301
327
```
302
328
@@ -305,7 +331,7 @@ docker compose up -d
305
331
7 . MegaService
306
332
307
333
``` bash
308
- curl http:// ${host_ip} :8888/v1/videoqna -H " Content-Type: application/json" -d ' {
334
+ curl ${BACKEND_SERVICE_ENDPOINT} -H " Content-Type: application/json" -d ' {
309
335
"messages": "What is the man doing?",
310
336
"stream": "True"
311
337
}'
@@ -343,4 +369,5 @@ To clean the volume:
343
369
344
370
``` bash
345
371
docker volume rm video-llama-model
372
+ docker volume rm videoqna-cache
346
373
```
0 commit comments