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

Method __init__

data_utils/corpora.py:39–45  ·  view source on GitHub ↗
(self, text_loader, mask_loader, **kwargs)

Source from the content-addressed store, hash-verified

37
38class KeyDataset(data.Dataset):
39 def __init__(self, text_loader, mask_loader, **kwargs):
40 self.texts = text_loader
41 self.masks = mask_loader
42 self.is_lazy = False
43 if isinstance(self.texts, LazyLoader) and isinstance(self.masks, LazyLoader):
44 self.text_lens = self.texts.lens
45 self.is_lazy = True
46
47 def get_text_len(self, idx):
48 return self.text_lens[idx]

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected