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

Class ByteTextEncoderWithEos

utils/text_encoder.py:150–154  ·  view source on GitHub ↗

Encodes each byte to an id and appends the EOS token.

Source from the content-addressed store, hash-verified

148
149
150class ByteTextEncoderWithEos(ByteTextEncoder):
151 """Encodes each byte to an id and appends the EOS token."""
152
153 def encode(self, s):
154 return super(ByteTextEncoderWithEos, self).encode(s) + [EOS_ID]
155
156
157class TokenTextEncoder(TextEncoder):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected