From f3d5544849fa2e61966dd50cc9f2fa1546b419c0 Mon Sep 17 00:00:00 2001 From: sd109 Date: Thu, 31 Oct 2024 17:44:09 +0000 Subject: [PATCH] Remove top_k from vision model UI options --- charts/azimuth-image-analysis/azimuth-ui.schema.yaml | 4 +++- charts/azimuth-image-analysis/ci/ui-only-values.yaml | 1 - charts/azimuth-image-analysis/values.schema.json | 8 +------- web-apps/image-analysis/defaults.yml | 4 +++- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/charts/azimuth-image-analysis/azimuth-ui.schema.yaml b/charts/azimuth-image-analysis/azimuth-ui.schema.yaml index 885ca8e..a960081 100644 --- a/charts/azimuth-image-analysis/azimuth-ui.schema.yaml +++ b/charts/azimuth-image-analysis/azimuth-ui.schema.yaml @@ -27,5 +27,7 @@ sortOrder: - /azimuth-llm/ui/appSettings/llm_params/frequency_penalty - /azimuth-llm/ui/appSettings/llm_params/presence_penalty - /azimuth-llm/ui/appSettings/llm_params/top_p - - /azimuth-llm/ui/appSettings/llm_params/top_k + # vLLM responds with HTTP 400 BadRequest when top_k is + # passed to a vision model (but ollama accepts it) + # - /azimuth-llm/ui/appSettings/llm_params/top_k - /azimuth-llm/api/modelMaxContextLength diff --git a/charts/azimuth-image-analysis/ci/ui-only-values.yaml b/charts/azimuth-image-analysis/ci/ui-only-values.yaml index b66347d..96f716d 100644 --- a/charts/azimuth-image-analysis/ci/ui-only-values.yaml +++ b/charts/azimuth-image-analysis/ci/ui-only-values.yaml @@ -11,6 +11,5 @@ azimuth-llm: max_tokens: 101 temperature: 0.1 top_p: 0.15 - top_k: 1 presence_penalty: 0.9 frequency_penalty: 1 diff --git a/charts/azimuth-image-analysis/values.schema.json b/charts/azimuth-image-analysis/values.schema.json index 7f747e4..c8be1ac 100644 --- a/charts/azimuth-image-analysis/values.schema.json +++ b/charts/azimuth-image-analysis/values.schema.json @@ -58,6 +58,7 @@ "description": "Model name supplied to the OpenAI client in frontend web app. Should match huggingface.model above." }, "llm_params": { + "$comment": "top_k parameter causes vLLM to error for most (all?) vision models so is excluded here", "type": "object", "properties": { "max_tokens": { @@ -82,13 +83,6 @@ "exclusiveMinimum": 0, "maximum": 1 }, - "top_k": { - "type": "integer", - "title": "LLM Top K", - "description": "The [top k](https://docs.vllm.ai/en/stable/dev/sampling_params.html) value to use when generating LLM responses (must be an integer).", - "default": -1, - "minimum": -1 - }, "presence_penalty": { "type": "number", "title": "LLM Presence Penalty", diff --git a/web-apps/image-analysis/defaults.yml b/web-apps/image-analysis/defaults.yml index e6f2791..21d233c 100644 --- a/web-apps/image-analysis/defaults.yml +++ b/web-apps/image-analysis/defaults.yml @@ -18,7 +18,9 @@ llm_params: max_tokens: temperature: top_p: - top_k: + # vLLM rejects requests with top_k parameter for + # most (all?) vision models so can't use it here + # top_k: frequency_penalty: presence_penalty: