Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milocress committed Apr 10, 2024
1 parent 4965cd2 commit 53889fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def build_optimizer(
'optimizer config. Please remove it from the optimizer config kwargs.'
)

kwargs['params'] = params
kwargs['params'] = list(params)
return construct_from_registry(name=name,
registry=registry.optimizers,
partial_function=True,
Expand Down Expand Up @@ -438,7 +438,9 @@ def build_tokenizer(
int(1e30),
)

if not hasattr(tokenizer, 'eos_token') or tokenizer.eos_token is None:
if not hasattr(
tokenizer, 'eos_token'
) or tokenizer.eos_token is None: # type: ignore (sometime's it's not none but that's ok too)
raise ValueError(
f'The tokenizer {tokenizer_name} must have an eos_token.')

Expand Down
2 changes: 1 addition & 1 deletion scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def validate_config(cfg: TrainConfig):
loaders = [cfg.train_loader]
if cfg.eval_loader is not None or cfg.eval_loaders is not None:
eval_loader = cfg.eval_loader
if isinstance(cfg.eval_loaders, ListConfig):
if isinstance(cfg.eval_loaders, list):
for loader in cfg.eval_loaders:
if 'label' not in loader:
raise ValueError(
Expand Down

0 comments on commit 53889fd

Please sign in to comment.