From 3aa6190d244d5a0260e47af6cc7042ebaaccb242 Mon Sep 17 00:00:00 2001 From: Eitan Turok <150733043+eitanturok@users.noreply.github.com> Date: Mon, 12 Feb 2024 19:11:52 -0500 Subject: [PATCH] replaced icl with icl_cfg; made better error message --- llmfoundry/utils/builders.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/llmfoundry/utils/builders.py b/llmfoundry/utils/builders.py index 294870c67e..3ab9451d0e 100644 --- a/llmfoundry/utils/builders.py +++ b/llmfoundry/utils/builders.py @@ -499,11 +499,15 @@ def _validate_cfg(icl_cfg: DictConfig): icl_cfg.pass_at_k = 1 if 'generations_per_sample' not in icl_cfg: if 'num_beams' in icl_cfg: - icl_cfg.generations_per_sample = icl.num_beams + icl_cfg.generations_per_sample = icl_cfg.num_beams warnings.warn( - ('num_beams is deprecated and will be removed in a future release.' - f'Please use generations_per_sample: {icl.num_beams}'), - DeprecationWarning, + x = ( + 'num_beams is deprecated and will be removed in a future release. ' + 'To specify the number of generations per sample please use ' + f'generations_per_sample: {icl_cfg.num_beams}. To specify ' + 'the number of beams for beam search decoding please use ' + f'num_beams: {icl_cfg.num_beams} in generation_kwargs.') + DeprecationWarning, ) else: icl_cfg.generations_per_sample = 20