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

Function general_detokenize

test/general/lm_eval/utils.py:125–132  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

123
124
125def general_detokenize(string):
126 string = string.replace(" n't", "n't")
127 string = string.replace(" )", ")")
128 string = string.replace("( ", "(")
129 string = string.replace('" ', '"')
130 string = string.replace(' "', '"')
131 string = re.sub(r" (['.,])", r"\1", string)
132 return string
133
134
135def get_rolling_token_windows(token_list, prefix_token, max_seq_len, context_len):

Callers 3

doc_to_textMethod · 0.90
doc_to_textMethod · 0.90
doc_to_textMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected