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

Class ZStdTextReader

test/general/lm_eval/decontamination/archiver.py:151–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149# Optimized for speed. Decompresses the archive in shell before
150# using the mmap'd TextReader.
151class ZStdTextReader:
152 def __init__(self, file):
153 self.file = file
154
155 def read_tqdm(self):
156 decompressed_file = self.file[:-4]
157 print("Decompressing file, please wait...")
158 os.system(f"zstd -d {self.file}") # linux decompress is faster
159 reader = TextReader(decompressed_file)
160 yield from reader.read_tqdm()
161 os.remove(decompressed_file)

Callers 1

get_train_overlapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected