MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / preprocess

Function preprocess

test/gsm8k/test.py:96–103  ·  view source on GitHub ↗
(
    sources,
    targets,
    tokenizer: transformers.PreTrainedTokenizer,
)

Source from the content-addressed store, hash-verified

94
95
96def preprocess(
97 sources,
98 targets,
99 tokenizer: transformers.PreTrainedTokenizer,
100):
101 sources_tokenized = _tokenize_fn(sources, tokenizer)
102 input_ids = sources_tokenized["input_ids"]
103 return dict(input_ids=input_ids, labels=copy.deepcopy(input_ids))
104
105
106class SupervisedDataset(Dataset):

Callers 1

__init__Method · 0.70

Calls 1

_tokenize_fnFunction · 0.70

Tested by

no test coverage detected