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

Function tokenize

trl/examples/scripts/ppo/ppo.py:136–141  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

134 """pre-tokenize the dataset before training; only collate during training"""
135
136 def tokenize(element):
137 outputs = tokenizer(
138 element[dataset_text_field],
139 padding=False,
140 )
141 return {"input_ids": outputs["input_ids"]}
142
143 return dataset.map(
144 tokenize,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected