MCPcopy
hub / github.com/lucidrains/DALLE-pytorch / encode

Method encode

dalle_pytorch/tokenizer.py:174–175  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

172 return self.tokenizer.decode(tokens, skip_special_tokens = True)
173
174 def encode(self, text):
175 return self.tokenizer.encode(text).ids
176
177 def tokenize(self, texts, context_length = 256, truncate_text = False):
178 if isinstance(texts, str):

Callers 6

tokenizeMethod · 0.95
encodeMethod · 0.45
encodeMethod · 0.45
encodeMethod · 0.45
get_codebook_indicesMethod · 0.45
generate_textsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected