keras/src/utils/text_dataset_utils.py/path_to_string_content
def path_to_string_content(path, max_length):
    txt = tf.io.read_file(path)
    if max_length is not None:
        txt = tf.strings.substr(txt, 0, max_length)
    return txt