-
Notifications
You must be signed in to change notification settings - Fork 98
gpt-sovits: Support air gapped environment #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,34 @@ helm install gpt-sovits gpt-sovits --set global.modelUseHostPath=${MODELDIR} | |||||||||||||||||
|
|
||||||||||||||||||
| The gpt-sovits service will download model `lj1995/GPT-SoVITS` which is about 2.8GB. | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Install the microservice in air gapped (offline) mode | ||||||||||||||||||
|
|
||||||||||||||||||
| To run `gpt-sovits` microservice in an air gapped environment, users are required to pre-download the model `lj1995/GPT-SoVITS` to a shared storage. | ||||||||||||||||||
|
|
||||||||||||||||||
| Below is an example for using node level local directory to download the model data: | ||||||||||||||||||
|
|
||||||||||||||||||
| Assuming the model data is shared using node-local directory `/mnt/opea-models`. | ||||||||||||||||||
|
|
||||||||||||||||||
| ``` | ||||||||||||||||||
| # On every K8s node, run the following command: | ||||||||||||||||||
| export MODEL_DIR=/mnt/opea-models | ||||||||||||||||||
| # Download model, assumes Python huggingface_hub[cli] module is already installed | ||||||||||||||||||
| huggingface-cli download --local-dir-use-symlinks False --local-dir "${MODEL_DIR}/lj1995/GPT-SoVITS" lj1995/GPT-SoVITS | ||||||||||||||||||
| # On K8s master node, run the following command: | ||||||||||||||||||
| # Install using Helm with the following additional parameters: | ||||||||||||||||||
| helm install ... ... --set global.offline=true,global.modelUseHostPath=${MODEL_DIR} | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| Assuming we share the offline data on cluster level using a persistent volume (PV), first we need to create the persistent volume claim (PVC) with name `opea-model-pvc` to store the model data. | ||||||||||||||||||
|
|
||||||||||||||||||
| ``` | ||||||||||||||||||
| # Download model openai/whisper-small at the root directory of the corresponding PV | ||||||||||||||||||
| # ... ... | ||||||||||||||||||
| # Install using Helm with the following additional parameters: | ||||||||||||||||||
| # export MODEL_PVC=opea-model-pvc | ||||||||||||||||||
| # helm install ... ... --set global.offline=true,global.modelUsePVC=${MODEL_PVC} | ||||||||||||||||||
|
Comment on lines
+37
to
+40
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO more readable with single
Suggested change
|
||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Verify | ||||||||||||||||||
|
|
||||||||||||||||||
| To verify the installation, run the command `kubectl get pod` to make sure all pods are running. | ||||||||||||||||||
|
|
@@ -40,9 +68,11 @@ curl localhost:9880/ -XPOST -d '{ | |||||||||||||||||
|
|
||||||||||||||||||
| ## Values | ||||||||||||||||||
|
|
||||||||||||||||||
| | Key | Type | Default | Description | | ||||||||||||||||||
| | ------------------------------- | ------ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||||||||||||||||
| | image.repository | string | `"opea/gpt-sovits"` | | | ||||||||||||||||||
| | service.port | string | `"9880"` | | | ||||||||||||||||||
| | 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 the container and the downloaded model will be saved to directory `lj1995/GPT-SoVITS`. Set this to null/empty will force it to download model. | | ||||||||||||||||||
| | Key | Type | Default | Description | | ||||||||||||||||||
| | ------------------------------- | ------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||||||||||||||||
| | image.repository | string | `"opea/gpt-sovits"` | | | ||||||||||||||||||
| | service.port | string | `"9880"` | | | ||||||||||||||||||
| | global.HUGGINGFACEHUB_API_TOKEN | string | `insert-your-huggingface-token-here` | Hugging Face API token | | ||||||||||||||||||
| | global.offline | bool | `false` | Whether to run the microservice in air gapped environment | | ||||||||||||||||||
| | global.modelUseHostPath | string | `""` | Cached models directory on Kubernetes node, service will not download if the model is cached here. The host path "modelUseHostPath" will be mounted to the container as /data directory. Setting this to null/empty will force the pod to download the model every time during startup. May not be set if `global.modelUsePVC` is also set. | | ||||||||||||||||||
| | global.modelUsePVC | string | `""` | Name of Persistent Volume Claim to use for model cache. The Persistent Volume will be mounted to the container as /data directory. Setting this to null/empty will force the pod to download the model every time during startup. May not be set if `global.modelUseHostPath` is also set. | | ||||||||||||||||||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.