PTWM
cli

ptwm.cli.compress

ptwm.cli.compress

pymodule

ptwm.cli.compress

python/ptwm/cli/compress.py:1
module ptwm.cli.compress
pyfunction

ptwm.cli.compress.add_compress_parser

python/ptwm/cli/compress.py:715
def add_compress_parser(subparsers)
pyfunction

ptwm.cli.compress.compress_file

python/ptwm/cli/compress.py:118
def compress_file(input_file: str, dtype: str = 'bfloat16', streaming_chunk_size: int | str = 1048576, delete: bool = False, force: bool = False, hf_cache: bool = False, method: str = 'HUFFMAN', verification: bool = False, test: bool = False, is_streaming: bool = False, threads: int | None = None, quiet: bool = False, codec_menu: list[CodecId] | None = None) -> None

Compress a single file.

pyfunction

ptwm.cli.compress.compress_file_delta

python/ptwm/cli/compress.py:225
def compress_file_delta(input_file: str, delta_file: str, dtype: str = 'bfloat16', streaming_chunk_size: int | str = 1048576, delete: bool = False, force: bool = False, hf_cache: bool = False, method: str = 'HUFFMAN', verification: bool = False, test: bool = False, is_streaming: bool = False, threads: int | None = None, codec_menu: list[CodecId] | None = None) -> None

Compress a file using delta compression.

pyfunction

ptwm.cli.compress.compress_path

python/ptwm/cli/compress.py:431
def compress_path(suffix: str, dtype: str = 'bfloat16', streaming_chunk_size: int | str = 1048576, path: str = '.', delete: bool = False, recursive: bool = False, force: bool = False, max_processes: int = 1, hf_cache: bool = False, model: str = '', branch: str = 'main', method: str = 'HUFFMAN', verification: bool = False, test: bool = False, is_streaming: bool = False, threads: int | None = None, file_compression: bool = False, codec_menu: list[CodecId] | None = None) -> None

Compress all files with the given suffix in the specified path.

pyfunction

ptwm.cli.compress.compress_safetensors_file

python/ptwm/cli/compress.py:322
def compress_safetensors_file(filename: str, delete: bool = False, force: bool = False, hf_cache: bool = False, method: str | None = None, threads: int | None = None, quiet: bool = False, codec_menu: list[CodecId] | None = None) -> None

Compress a safetensors file.

pyfunction

ptwm.cli.compress.handle_compress

python/ptwm/cli/compress.py:1060
def handle_compress(args)
pyfunction

ptwm.cli.compress.main

python/ptwm/cli/compress.py:593
def main(argv: list[str] | None = None) -> int

Standalone entry point: parse flags and dispatch to the appropriate codec.

Distinct from ``handle_compress`` (driven by the ``ptwm compress`` sub- command parser). Owns a dedicated argparse parser exposing ``--mode``, ``--classify-*``, ``--max-shard-size``, ``--out`` alongside a single positional input path. For ``.safetensors`` inputs, delegates to ``ptwm.integrations.compress_safetensors_file``; all other input types fall back to ``compress_file``.