MCPcopy
hub / github.com/facebookresearch/MetaCLIP / whitespace_clean

Function whitespace_clean

src/mini_clip/tokenizer.py:64–67  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

62
63
64def whitespace_clean(text):
65 text = re.sub(r'\s+', ' ', text)
66 text = text.strip()
67 return text
68
69
70class SimpleTokenizer(object):

Callers 1

encodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected