Skip to content

Commit

Permalink
Enable using PV as model cache directory
Browse files Browse the repository at this point in the history
Set modelUsePV to pvc name for model cache

Signed-off-by: Dolpher Du <[email protected]>
  • Loading branch information
yongfengdu committed Aug 8, 2024
1 parent 4319660 commit df9ec05
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 6 deletions.
3 changes: 3 additions & 0 deletions helm-charts/common/speecht5/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ spec:
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/common/speecht5/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,10 @@ global:
http_proxy: ""
https_proxy: ""
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
3 changes: 3 additions & 0 deletions helm-charts/common/tei/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ spec:
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
8 changes: 6 additions & 2 deletions helm-charts/common/tei/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ global:
http_proxy: ""
https_proxy: ""
no_proxy: ""
# set modelUseHostPath to host directory if you want to use hostPath volume for model storage
# comment out modeluseHostPath if you want to download the model from huggingface

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
3 changes: 3 additions & 0 deletions helm-charts/common/teirerank/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ spec:
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
8 changes: 6 additions & 2 deletions helm-charts/common/teirerank/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ global:
http_proxy: ""
https_proxy: ""
no_proxy: ""
# set modelUseHostPath to host directory if you want to use hostPath volume for model storage
# comment out modeluseHostPath if you want to download the model from huggingface

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
3 changes: 3 additions & 0 deletions helm-charts/common/tgi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ spec:
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
8 changes: 6 additions & 2 deletions helm-charts/common/tgi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ global:
https_proxy: ""
no_proxy: ""
HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here"
# set modelUseHostPath to host directory if you want to use hostPath volume for model storage
# comment out modeluseHostPath if you want to download the model from huggingface

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
3 changes: 3 additions & 0 deletions helm-charts/common/whisper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ spec:
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/common/whisper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ global:
http_proxy: ""
https_proxy: ""
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume

0 comments on commit df9ec05

Please sign in to comment.