MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / _tokenize

Method _tokenize

diffsynth/extensions/ImageQualityMetric/mps.py:55–63  ·  view source on GitHub ↗
(caption)

Source from the content-addressed store, hash-verified

53 float: The reward score.
54 """
55 def _tokenize(caption):
56 input_ids = self.tokenizer(
57 caption,
58 max_length=self.tokenizer.model_max_length,
59 padding="max_length",
60 truncation=True,
61 return_tensors="pt"
62 ).input_ids
63 return input_ids
64
65 text_input = _tokenize(prompt).to(self.device)
66 if self.condition == 'overall':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected