MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / wp_encode

Method wp_encode

openrec/preprocess/mgp_label_encode.py:89–95  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

87 return text_list
88
89 def wp_encode(self, text):
90 wp_target = self.wp_tokenizer([text],
91 padding='max_length',
92 max_length=self.batch_max_length,
93 truncation=True,
94 return_tensors='np')
95 return wp_target['input_ids'][0]

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected