MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / tokenize

Method tokenize

utils/clip_eval.py:23–24  ·  view source on GitHub ↗
(self, strings: list)

Source from the content-addressed store, hash-verified

21 clip_preprocess.transforms[4:]) # + skip convert PIL to tensor
22
23 def tokenize(self, strings: list):
24 return clip.tokenize(strings).to(self.device)
25
26 @torch.no_grad()
27 def encode_text(self, tokens: list) -> torch.Tensor:

Callers 3

get_text_featuresMethod · 0.80
tokenizeFunction · 0.80
__getitem__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected