From 1d1c45dc1a55081b945914a06f39de5f7e9716f9 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Wed, 11 Oct 2023 12:22:50 -0600 Subject: [PATCH] add length penalty param to vllm --- llm_server/helpers.py | 3 ++- llm_server/llm/vllm/vllm_backend.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llm_server/helpers.py b/llm_server/helpers.py index 9fc7274..91f3b15 100644 --- a/llm_server/helpers.py +++ b/llm_server/helpers.py @@ -54,7 +54,8 @@ def jsonify_pretty(json_dict: Union[list, dict], status=200, indent=4, sort_keys def round_up_base(n, base): if base == 0: - print('round_up_base DIVIDE BY ZERO ERROR????', n, base) + # TODO: I don't think passing (0, 0) to this function is a sign of any underlying issues. + # print('round_up_base DIVIDE BY ZERO ERROR????', n, base) return 0 return math.ceil(n / base) * base diff --git a/llm_server/llm/vllm/vllm_backend.py b/llm_server/llm/vllm/vllm_backend.py index a9ec821..835d2ce 100644 --- a/llm_server/llm/vllm/vllm_backend.py +++ b/llm_server/llm/vllm/vllm_backend.py @@ -39,7 +39,8 @@ class VLLMBackend(LLMBackend): ignore_eos=parameters.get('ban_eos_token', False), max_tokens=parameters.get('max_new_tokens') or parameters.get('max_tokens', self._default_params['max_tokens']), presence_penalty=parameters.get('presence_penalty', self._default_params['presence_penalty']), - frequency_penalty=parameters.get('frequency_penalty', self._default_params['frequency_penalty']) + frequency_penalty=parameters.get('frequency_penalty', self._default_params['frequency_penalty']), + length_penalty=parameters.get('length_penalty', self._default_params['length_penalty']) ) except ValueError as e: return None, str(e).strip('.')