How do you retain compound extensions for training shards?
suffixes returns dot-delimited suffixes in order, exposing separate data and compression extensions.
Python example and interpretation
train.jsonl.gz advertises a data format followed by a compression format. A filename is only a declaration; verify the payload when decoding it.
from pathlib import PurePosixPath as P
P('fold/train.jsonl.gz').suffixesResult ['.jsonl', '.gz']
中文
怎样保留训练分片的多层文件后缀?
suffixes 依序返回文件名末尾按点分隔的各段后缀,可区分数据格式与外层压缩格式。
Python 算例与适用条件
train.jsonl.gz 的内容格式和压缩格式分别占一项。文件名只是声明,真正解码前还需核对实际文件内容。
from pathlib import PurePosixPath as P
P('fold/train.jsonl.gz').suffixes结果 ['.jsonl', '.gz']