We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43ab0e0 commit c3be5d3Copy full SHA for c3be5d3
megatron/model/gpt_model.py
@@ -254,13 +254,12 @@ def _to_float16(inputs):
254
# TODO: Change naming of class from GPT to something that encapsulate prefix lm.
255
self_attn_mask_type=attn_mask_type))
256
257
-
258
- if not hasattr(args, 'attn_mask'):
259
- # We drop attention mask from the pipeline
260
- self.specs.append(lambda x: x[0])
261
262
# Undo data format change
263
- self.specs.append(lambda x: x.transpose(0, 1).contiguous())
+ def undo(x):
+ if not hasattr(args, 'attn_mask'):
+ x = x[0]
+ return x.transpose(0, 1).contiguous()
+ self.specs.append(undo)
264
265
# Final layernorm after transformer layers
266
self.specs.append(
0 commit comments