MCPcopy Create free account
hub / github.com/bytedance/MegaTTS3 / decode

Method decode

tts/utils/text_utils/text_encoder.py:174–181  ·  view source on GitHub ↗
(self, ids, strip_eos=False, strip_padding=False)

Source from the content-addressed store, hash-verified

172 return ret[::-1] if self._reverse else ret
173
174 def decode(self, ids, strip_eos=False, strip_padding=False):
175 if strip_padding and self.pad() in list(ids):
176 pad_pos = list(ids).index(self.pad())
177 ids = ids[:pad_pos]
178 if strip_eos and self.eos() in list(ids):
179 eos_pos = list(ids).index(self.eos())
180 ids = ids[:eos_pos]
181 return " ".join(self.decode_list(ids))
182
183 def decode_list(self, ids):
184 seq = reversed(ids) if self._reverse else ids

Callers

nothing calls this directly

Calls 3

padMethod · 0.95
eosMethod · 0.95
decode_listMethod · 0.95

Tested by

no test coverage detected