MCPcopy Create free account
hub / github.com/AMAP-ML/EMF / tokenize

Function tokenize

trl/examples/scripts/rloo/rloo.py:108–113  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

106 """pre-tokenize the dataset before training; only collate during training"""
107
108 def tokenize(element):
109 outputs = tokenizer(
110 element[dataset_text_field],
111 padding=False,
112 )
113 return {"input_ids": outputs["input_ids"]}
114
115 return dataset.map(
116 tokenize,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected