From 6eb8053508adbd50483e12b00193059eb4a1a221 Mon Sep 17 00:00:00 2001 From: Scott Davidson <49713135+sd109@users.noreply.github.com> Date: Thu, 9 May 2024 20:55:38 +0100 Subject: [PATCH 1/2] Fix conditional bug in API deployment templating --- chart/templates/api/deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chart/templates/api/deployment.yml b/chart/templates/api/deployment.yml index 59478c3..a5f6f4f 100644 --- a/chart/templates/api/deployment.yml +++ b/chart/templates/api/deployment.yml @@ -36,10 +36,10 @@ spec: envFrom: - secretRef: name: huggingface-token - {{- else if .Values.huggingface.token }} env: - name: DO_NOT_TRACK - value: 1 + value: "1" + {{- else if .Values.huggingface.token }} - name: HUGGING_FACE_HUB_TOKEN value: {{ quote .Values.huggingface.token }} {{- else if contains "Llama" .Values.huggingface.model -}} @@ -60,4 +60,4 @@ spec: - name: shm emptyDir: medium: Memory - sizeLimit: 1Gi \ No newline at end of file + sizeLimit: 1Gi From 00d4865e14e630faf10e6a67bc42b3fcb2b9346c Mon Sep 17 00:00:00 2001 From: Scott Davidson <49713135+sd109@users.noreply.github.com> Date: Thu, 9 May 2024 20:59:58 +0100 Subject: [PATCH 2/2] Fix conditional checks for HF tokens --- chart/templates/api/deployment.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chart/templates/api/deployment.yml b/chart/templates/api/deployment.yml index a5f6f4f..fef02d1 100644 --- a/chart/templates/api/deployment.yml +++ b/chart/templates/api/deployment.yml @@ -35,15 +35,14 @@ spec: {{- if .Values.huggingface.secretName }} envFrom: - secretRef: - name: huggingface-token + name: {{ .Values.huggingface.secretName }} + {{- end }} env: - name: DO_NOT_TRACK value: "1" - {{- else if .Values.huggingface.token }} + {{- if .Values.huggingface.token }} - name: HUGGING_FACE_HUB_TOKEN value: {{ quote .Values.huggingface.token }} - {{- else if contains "Llama" .Values.huggingface.model -}} - {{- fail "Either secretName or token value must be set for Llama and other gated models" }} {{- end }} readinessProbe: httpGet: