Skip to content

Commit

Permalink
replaced icl with icl_cfg; made better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
eitanturok authored Feb 13, 2024
1 parent 090355c commit 3aa6190
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3aa6190

Please sign in to comment.