MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / export_single_file

Function export_single_file

tools/convert/export_dummy_meta.py:59–66  ·  view source on GitHub ↗

Export one safetensors file to its dummy-meta counterpart.

(input_path: str, output_path: str)

Source from the content-addressed store, hash-verified

57
58
59def export_single_file(input_path: str, output_path: str):
60 """Export one safetensors file to its dummy-meta counterpart."""
61 tensor_meta = read_tensor_metadata(input_path)
62 write_dummy_meta_safetensors(tensor_meta, output_path, source_filename=os.path.basename(input_path))
63
64 input_size = os.path.getsize(input_path)
65 output_size = os.path.getsize(output_path)
66 print(f" {os.path.basename(input_path)}: {input_size / 1024 / 1024:.1f} MB -> {output_size / 1024:.1f} KB ({len(tensor_meta)} tensors)")
67
68
69def main():

Callers 1

mainFunction · 0.85

Calls 2

read_tensor_metadataFunction · 0.85

Tested by

no test coverage detected