MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / decode_list

Method decode_list

utils/text_encoder.py:133–143  ·  view source on GitHub ↗
(self, ids)

Source from the content-addressed store, hash-verified

131 return b"".join(decoded_ids).decode("utf-8", "replace")
132
133 def decode_list(self, ids):
134 numres = self._num_reserved_ids
135 decoded_ids = []
136 int2byte = six.int2byte
137 for id_ in ids:
138 if 0 <= id_ < numres:
139 decoded_ids.append(RESERVED_TOKENS_BYTES[int(id_)])
140 else:
141 decoded_ids.append(int2byte(id_ - numres))
142 # Python3: join byte arrays and then decode string
143 return decoded_ids
144
145 @property
146 def vocab_size(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected