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

Method clean

test/general/lm_eval/decontamination/janitor.py:159–167  ·  view source on GitHub ↗

Clean a string (e.g. a training set) by removing all ngrams previously registered as contaminants. Returns a list of clean chunks, or empty if the string was too dirty

(self, dirty_string)

Source from the content-addressed store, hash-verified

157 return self.register_contaminant_python(dirt_string)
158
159 def clean(self, dirty_string):
160 """Clean a string (e.g. a training set) by removing all ngrams previously
161 registered as contaminants. Returns a list of clean chunks, or empty if
162 the string was too dirty"""
163 if JANITOR_CPP:
164 return self.clean_cpp(dirty_string)
165 else:
166 print("WARNING: Janitor running in python mode")
167 return self.clean_python(dirty_string)
168
169 def _split_chunks(self, dirty_string, dirty_parts):
170 clean_chunks = []

Callers

nothing calls this directly

Calls 2

clean_cppMethod · 0.95
clean_pythonMethod · 0.95

Tested by

no test coverage detected