MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / _compare

Function _compare

codegeex/megatron/checkpointing.py:48–58  ·  view source on GitHub ↗
(arg_name, old_arg_name=None)

Source from the content-addressed store, hash-verified

46 args = get_args()
47
48 def _compare(arg_name, old_arg_name=None):
49 if old_arg_name is not None:
50 checkpoint_value = getattr(checkpoint_args, old_arg_name)
51 else:
52 checkpoint_value = getattr(checkpoint_args, arg_name)
53 args_value = getattr(args, arg_name)
54 error_message = (
55 "{} value from checkpoint ({}) is not equal to the "
56 "input argument value ({}).".format(arg_name, checkpoint_value, args_value)
57 )
58 assert checkpoint_value == args_value, error_message
59
60 _compare("num_layers")
61 _compare("hidden_size")

Callers 1

check_checkpoint_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected