MCPcopy Create free account
hub / github.com/THUDM/GLM / pad_seq

Method pad_seq

data_utils/datasets.py:1083–1088  ·  view source on GitHub ↗

helper function to pad sequence pair

(self, seq)

Source from the content-addressed store, hash-verified

1081 return label
1082
1083 def pad_seq(self, seq):
1084 """helper function to pad sequence pair"""
1085 num_pad = max(0, self.max_seq_len - len(seq))
1086 pad_mask = [0] * len(seq) + [1] * num_pad
1087 seq += [self.tokenizer.get_command('pad').Id] * num_pad
1088 return seq, pad_mask
1089
1090 def create_masked_lm_predictions(self, a, b, mask_lm_prob, max_preds_per_seq, vocab_words, rng):
1091 """

Callers 1

Calls 1

get_commandMethod · 0.80

Tested by

no test coverage detected