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

Method getidx

data_utils/datasets.py:684–689  ·  view source on GitHub ↗
(self, data_idx)

Source from the content-addressed store, hash-verified

682 return tokens, loss_mask
683
684 def getidx(self, data_idx):
685 data = self.ds[data_idx]
686 tokens, loss_masks = data['tokens'], data['loss_masks']
687 tokens = tokens + [self.tokenizer.get_command('eos').Id]
688 loss_masks = loss_masks + [1]
689 return tokens, loss_masks
690
691 def pad_seq(self, seq, pad_id=None):
692 total_tokens = self.max_seq_len

Callers 1

get_weighted_samplesMethod · 0.95

Calls 1

get_commandMethod · 0.80

Tested by

no test coverage detected