Skip to content

Commit

Permalink
Adapt latest changes in asr/tts related components
Browse files Browse the repository at this point in the history
Adapt the latest changes in helm charts of the following components:

- asr
- whisper
- tts
- speecht5
- gpt-sovits

Signed-off-by: Lianhao Lu <[email protected]>
  • Loading branch information
lianhao committed Jan 9, 2025
1 parent d9e5ed0 commit f33493d
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 104 deletions.
2 changes: 2 additions & 0 deletions helm-charts/common/asr/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
7 changes: 4 additions & 3 deletions helm-charts/common/asr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ Then run the command `kubectl port-forward svc/asr 9099:9099` to expose the asr
Open another terminal and run the following command to verify the service if working:

```console
wget https://github.com/intel/intel-extension-for-transformers/raw/main/intel_extension_for_transformers/neural_chat/assets/audio/sample.wav
curl http://localhost:9099/v1/audio/transcriptions \
-XPOST \
-d '{"byte_str": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
-H 'Content-Type: application/json'
-H "Content-Type: multipart/form-data" \
-F file="@./sample.wav" \
-F model="openai/whisper-small"
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/asr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "asr.fullname" . }}-config
Expand Down
6 changes: 3 additions & 3 deletions helm-charts/common/asr/templates/tests/test-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ spec:
args:
- |
max_retry=20;
wget https://github.com/intel/intel-extension-for-transformers/raw/main/intel_extension_for_transformers/neural_chat/assets/audio/sample.wav;
for ((i=1; i<=max_retry; i++)); do
curl -sS --fail-with-body http://{{ include "asr.fullname" . }}:{{ .Values.service.port }}/v1/audio/transcriptions \
-XPOST \
-d '{"byte_str": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \
-H 'Content-Type: application/json' && break;
-H "Content-Type: multipart/form-data" \
-F file="@./sample.wav" && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
done;
Expand Down
29 changes: 9 additions & 20 deletions helm-charts/common/asr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

whisper:
enabled: false

replicaCount: 1

# Set it as a non-null string, such as true, if you want to enable logging facility,
# otherwise, keep it as "" to disable it.
# Set it as a non-null string, such as true, if you want to enable logging facility.
LOGFLAG: ""

ASR_ENDPOINT: ""
Expand Down Expand Up @@ -59,25 +55,14 @@ service:
# The default port for asr service is 9099
port: 9099

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: v1/health_check
port: asr
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: v1/health_check
Expand Down Expand Up @@ -106,3 +91,7 @@ global:
# If set, it will overwrite serviceAccount.name.
# If set, and serviceAccount.create is false, it will assume this service account is already created by others.
sharedSAName: ""

# Only for CI tests
whisper:
enabled: false
2 changes: 2 additions & 0 deletions helm-charts/common/gpt-sovits/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
6 changes: 1 addition & 5 deletions helm-charts/common/gpt-sovits/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "gpt-sovits.fullname" . }}-config
Expand All @@ -39,11 +39,7 @@ spec:
optional: true
{{- end }}
securityContext:
{{- if .Values.global.modelUseHostPath }}
{}
{{- else }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- if .Values.image.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down
20 changes: 4 additions & 16 deletions helm-charts/common/gpt-sovits/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ podSecurityContext: {}

securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
capabilities:
Expand All @@ -49,25 +48,14 @@ service:
type: ClusterIP
port: 9880

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
tcpSocket:
port: gpt-sovits
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 4
failureThreshold: 24
readinessProbe:
tcpSocket:
port: gpt-sovits
Expand Down
2 changes: 2 additions & 0 deletions helm-charts/common/speecht5/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
2 changes: 1 addition & 1 deletion helm-charts/common/speecht5/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
name: tmp
{{- end }}
containers:
- name: {{ .Release.Name }}
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "speecht5.fullname" . }}-config
Expand Down
19 changes: 4 additions & 15 deletions helm-charts/common/speecht5/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,14 @@ service:
# The default port for speecht5 service is 7055
port: 7055

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: /health
port: speecht5
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: /health
Expand Down
2 changes: 2 additions & 0 deletions helm-charts/common/tts/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
4 changes: 2 additions & 2 deletions helm-charts/common/tts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Open another terminal and run the following command to verify the service if wor
```console
curl http://localhost:9088/v1/audio/speech \
-XPOST \
-d '{"text": "Who are you?"}' \
-H 'Content-Type: application/json'
-d '{"input":"Who are you?", "voice": "male"}' \
-H 'Content-Type: application/json' --output speech.wav
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/tts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "tts.fullname" . }}-config
Expand Down
7 changes: 4 additions & 3 deletions helm-charts/common/tts/templates/tests/test-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ spec:
for ((i=1; i<=max_retry; i++)); do
curl -sS --fail-with-body http://{{ include "tts.fullname" . }}:{{ .Values.service.port }}/v1/audio/speech \
-XPOST \
-d '{"text": "Who are you?"}' \
-H 'Content-Type: application/json' && break;
-d '{"input":"Who are you?", "voice": "male"}' \
-H 'Content-Type: application/json' --output speech.wav && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
done;
if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi
if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi;
file speech.wav
restartPolicy: Never
26 changes: 8 additions & 18 deletions helm-charts/common/tts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

speecht5:
enabled: false

replicaCount: 1

# Set it as a non-null string, such as true, if you want to enable logging facility,
Expand Down Expand Up @@ -59,25 +56,14 @@ service:
# The default port for tts service is 9088
port: 9088

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: v1/health_check
port: tts
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: v1/health_check
Expand Down Expand Up @@ -106,3 +92,7 @@ global:
# If set, it will overwrite serviceAccount.name.
# If set, and serviceAccount.create is false, it will assume this service account is already created by others.
sharedSAName: ""

# For CI tests only
speecht5:
enabled: false
2 changes: 2 additions & 0 deletions helm-charts/common/whisper/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
2 changes: 1 addition & 1 deletion helm-charts/common/whisper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
name: tmp
{{- end }}
containers:
- name: {{ .Release.Name }}
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: {{ include "whisper.fullname" . }}-config
Expand Down
19 changes: 4 additions & 15 deletions helm-charts/common/whisper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,14 @@ service:
# The default port for whisper service is 7066
port: 7066

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: /health
port: whisper
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: /health
Expand Down

0 comments on commit f33493d

Please sign in to comment.