-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify embedding-usvc to support multimodal embedding
- Change embedding-usvc chart to adapt to latest chagnes - Support multimodal embedding Signed-off-by: Lianhao Lu <[email protected]>
- Loading branch information
Showing
25 changed files
with
813 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# CI values | ||
ci*-values.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
helm-charts/common/embedding-usvc/ci-multimodal-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Default values for embedding-usvc. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
tei: | ||
enabled: false | ||
mm-embedding: | ||
enabled: true | ||
|
||
EMBEDDING_BACKEND: "BridgeTower" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ | |
|
||
tei: | ||
enabled: true | ||
mm-embedding: | ||
enabled: false | ||
|
||
EMBEDDING_BACKEND: "TEI" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# CI values | ||
ci*-values.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (C) 2025 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: v2 | ||
appVersion: "1.1" | ||
description: A Helm chart for deploying opea multimodel embedding microservices | ||
name: mm-embedding | ||
type: application | ||
version: 0-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# OPEA mm-embedding microservice | ||
|
||
Helm chart for deploying OPEA multimodal embedding service. | ||
|
||
## Installing the Chart | ||
|
||
To install the chart, run the following: | ||
|
||
```console | ||
cd GenAIInfra/helm-charts/common | ||
export MODELDIR=/mnt/opea-models | ||
export HFTOKEN="insert-your-huggingface-token-here" | ||
# To deploy embedding-multimodal-bridgetower microserice on CPU | ||
helm install mm-embedding mm-embedding --set global.modelUseHostPath=${MODELDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} | ||
# To deploy embedding-multimodal-bridgetower microserice on Gaudi | ||
# helm install mm-embedding mm-embedding --set global.modelUseHostPath=${MODELDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --values mm-embedding/gaudi-values.yaml | ||
# To deploy embedding-multimodal-clip microserice on CPU | ||
# helm install mm-embedding mm-embedding --set global.modelUseHostPath=${MODELDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --values mm-embedding/variant_clip-values.yaml | ||
``` | ||
|
||
By default, the embedding-multimodal-bridgetower service will download the "BridgeTower/bridgetower-large-itm-mlm-itc" model which is about 3.5GB, and the embedding-multimodal-clip service will download the "openai/clip-vit-base-patch32" model which is about 1.7GB. | ||
|
||
If you already cached the model locally, you can pass it to container like this example: | ||
|
||
MODELDIR=/mnt/opea-models | ||
|
||
MODELNAME="/data/models--BridgeTower--bridgetower-large-itm-mlm-itc" | ||
|
||
## Verify | ||
|
||
To verify the installation, run the command `kubectl get pod` to make sure all pods are runinng and in ready state. | ||
|
||
Then run the command `kubectl port-forward svc/mm-embedding 6990:6990` to expose the mm-embedding service for access. | ||
|
||
Open another terminal and run the following command to verify the service if working: | ||
|
||
```console | ||
# Verify with embedding-multimodal-bridgetower | ||
curl http://localhost:6990/v1/encode \ | ||
-XPOST \ | ||
-d '{"text":"This is example"}' \ | ||
-H 'Content-Type: application/json' | ||
|
||
# Verify with embedding-multimodal-clip | ||
curl http://localhost:6990/v1/embeddings \ | ||
-XPOST \ | ||
-d '{"text":"This is example"}' \ | ||
-H 'Content-Type: application/json' | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
| ------------------------------- | ------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| global.HUGGINGFACEHUB_API_TOKEN | string | `insert-your-huggingface-token-here` | Hugging Face API token | | ||
| global.modelUseHostPath | string | `""` | Cached models directory, service will not download if the model is cached here. The host path "modelUseHostPath" will be mounted to container as /data directory. Set this to null/empty will force it to download model. | | ||
| autoscaling.enabled | bool | `false` | Enable HPA autoscaling for the service deployment based on metrics it provides. See [HPA instructions](../../HPA.md) before enabling! | | ||
| global.monitoring | bool | `false` | Enable usage metrics for the service. Required for HPA. See [monitoring instructions](../../monitoring.md) before enabling! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
variant_clip-values.yaml |
Oops, something went wrong.