MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / __init__

Method __init__

test/general/lm_eval/decontamination/archiver.py:22–29  ·  view source on GitHub ↗
(self, file_path, compression_level=3)

Source from the content-addressed store, hash-verified

20# Modified version of lm_dataformat Archive for single file.
21class Archive:
22 def __init__(self, file_path, compression_level=3):
23 self.file_path = file_path
24 dir_name = os.path.dirname(file_path)
25 if dir_name:
26 os.makedirs(dir_name, exist_ok=True)
27 self.fh = open(self.file_path, "wb")
28 self.cctx = zstandard.ZstdCompressor(level=compression_level)
29 self.compressor = self.cctx.stream_writer(self.fh)
30
31 def add_data(self, data, meta={}):
32 self.compressor.write(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected