(examples)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected