MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / validate_args

Function validate_args

finetune/full.py:653–674  ·  view source on GitHub ↗
(train: TrainArgs, eval: EvalArgs)

Source from the content-addressed store, hash-verified

651
652
653def validate_args(train: TrainArgs, eval: EvalArgs) -> None:
654 issues = []
655 unsupported = [(train, ['max_tokens', 'max_norm', 'tie_embeddings'])]
656 for args, names in unsupported:
657 for name in names:
658 if getattr(args, name) is not None:
659 issues.append(
660 f"{__file__} doesn't support the {name!r} argument. This is set in {args}"
661 )
662 required = [(train, ['epochs']), (eval, ['max_new_tokens'])]
663 for args, names in required:
664 for name in names:
665 if getattr(args, name) is None:
666 issues.append(
667 f'{__file__} requires the {name!r} argument. This is set in {args}'
668 )
669 if not train.epochs and not train.max_steps:
670 issues.append(
671 f'{__file__} requires either epochs or max_steps to be set. This is set in {train}'
672 )
673 if issues:
674 raise ValueError('\n'.join(issues))
675
676
677if __name__ == '__main__':

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected