MCPcopy Create free account
hub / github.com/WailordHe/DenseSSM / tokenize_function

Function tokenize_function

train.py:477–486  ·  view source on GitHub ↗
(examples)

Source from the content-addressed store, hash-verified

475 tok_logger = transformers.utils.logging.get_logger("transformers.tokenization_utils_base")
476
477 def tokenize_function(examples):
478 with CaptureLogger(tok_logger) as cl:
479 output = tokenizer(examples["text"])
480 # clm input could be much much longer than block_size
481 if "Token indices sequence length is longer than the" in cl.out:
482 tok_logger.warning(
483 "^^^^^^^^^^^^^^^^ Please ignore the warning above - this long input will be chunked into smaller bits"
484 " before being passed to the model."
485 )
486 return output
487
488 if data_args.block_size is None:
489 block_size = tokenizer.model_max_length

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected