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

Method preprocess

test/general/lm_eval/tasks/hellaswag.py:63–69  ·  view source on GitHub ↗
(cls, text)

Source from the content-addressed store, hash-verified

61
62 @classmethod
63 def preprocess(cls, text):
64 text = text.strip()
65 # NOTE: Brackets are artifacts of the WikiHow dataset portion of HellaSwag.
66 text = text.replace(" [title]", ". ")
67 text = re.sub("\\[.*?\\]", "", text)
68 text = text.replace(" ", " ")
69 return text
70
71 def doc_to_text(self, doc):
72 return doc["query"]

Callers 1

_process_docMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected