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

Method __init__

codegeex/megatron/model/codegeex_model.py:30–42  ·  view source on GitHub ↗
(self, num_tokentypes=0, parallel_output=False)

Source from the content-addressed store, hash-verified

28 """Code Generation Model for Multilingual Program Synthesis."""
29
30 def __init__(self, num_tokentypes=0, parallel_output=False):
31 super(CodeGeeXModel, self).__init__()
32 args = get_args()
33
34 self.parallel_output = parallel_output
35 self.fp16_lm_cross_entropy = args.fp16_lm_cross_entropy
36
37 self.language_model, self._language_model_key = get_language_model(
38 num_tokentypes=num_tokentypes,
39 add_pooler=False,
40 init_method=init_method_normal(args.init_method_std),
41 scaled_init_method=scaled_init_method_normal(args.init_method_std,
42 args.num_layers))
43
44 def set_input_tensor(self, input_tensor):
45 """See megatron.model.transformer.set_input_tensor()"""

Callers 1

__init__Method · 0.45

Calls 4

get_argsFunction · 0.90
get_language_modelFunction · 0.90
init_method_normalFunction · 0.90

Tested by

no test coverage detected