Skip to content

Commit

Permalink
Use huggingface-hub 0.26.5 to download model
Browse files Browse the repository at this point in the history
Upgrade huggingface-hub to version 0.26.5 when downloading models, due
to the existing huggingface/downloader:0.17.3 image doesn't acknowledge
the HF_TOKEN correctly.

Signed-off-by: Lianhao Lu <[email protected]>
  • Loading branch information
lianhao committed Dec 12, 2024
1 parent e9dc58a commit 39b96fb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
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 @@ -36,7 +36,6 @@ spec:
name: {{ include "speecht5.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if hasKey .Values.securityContext "runAsGroup" }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
{{- end }}
Expand All @@ -54,6 +53,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) {{ .Values.TTS_MODEL_PATH | quote }};
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) {{ .Values.VOCODER_MODEL| quote }};
chmod -R g+w /data/models--{{ replace "/" "--" .Values.TTS_MODEL_PATH }};
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/tei/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
name: {{ include "tei.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if hasKey .Values.securityContext "runAsGroup" }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
{{- end }}
Expand All @@ -57,6 +56,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) $(MODEL_ID);
chmod -R g+w /data/models--{{ replace "/" "--" .Values.EMBEDDING_MODEL_ID }}
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/teirerank/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
name: {{ include "teirerank.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if hasKey .Values.securityContext "runAsGroup" }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
{{- end }}
Expand All @@ -57,6 +56,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) $(MODEL_ID);
chmod -R g+w /data/models--{{ replace "/" "--" .Values.RERANK_MODEL_ID }}
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/tgi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
name: {{ include "tgi.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if hasKey .Values.securityContext "runAsGroup" }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
{{- end }}
Expand All @@ -57,6 +56,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) $(MODEL_ID);
chmod -R g+w /data/models--{{ replace "/" "--" .Values.LLM_MODEL_ID }}
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/vllm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ spec:
name: {{ include "vllm.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
Expand All @@ -51,6 +50,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) {{ .Values.LLM_MODEL_ID | quote }};
chmod -R g+w /data/models--{{ replace "/" "--" .Values.LLM_MODEL_ID }}
volumeMounts:
Expand Down
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 @@ -36,7 +36,6 @@ spec:
name: {{ include "whisper.fullname" . }}-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if hasKey .Values.securityContext "runAsGroup" }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
{{- end }}
Expand All @@ -54,6 +53,7 @@ spec:
command: ['sh', '-c']
args:
- |
pip install 'huggingface-hub==0.26.5';
huggingface-cli download --cache-dir /data --token $(HF_TOKEN) {{ .Values.ASR_MODEL_PATH | quote }};
chmod -R g+w /data/models--{{ replace "/" "--" .Values.ASR_MODEL_PATH }}
volumeMounts:
Expand Down

0 comments on commit 39b96fb

Please sign in to comment.