Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode() method in GPT4Tokenizer does not handle special tokens #64

Open
Vakarva opened this issue Apr 7, 2024 · 0 comments
Open

decode() method in GPT4Tokenizer does not handle special tokens #64

Vakarva opened this issue Apr 7, 2024 · 0 comments

Comments

@Vakarva
Copy link

Vakarva commented Apr 7, 2024

It appears that the decode() method in the GPT4Tokenizer class does not handle special tokens. I submitted a pull request (#63) with some updated code, but also wanted to post the issue here. Here is the original code for reference:

def decode(self, ids):
  # we have to un-permute the bytes before we decode
  text_bytes = b"".join(self.vocab[idx] for idx in ids)
  text_bytes = bytes(self.inverse_byte_shuffle[b] for b in text_bytes)
  text = text_bytes.decode("utf-8", errors="replace")
  return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant