-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Option to turn token integers back into text #7
Comments
Potential names for this:
I think I like I could add |
This should support space separated, comma separated and JSON arrays or integers. I think I'll just use a |
Got GPT-4 to write this: https://chat.openai.com/share/a3c5da38-bfd0-423d-af7e-dbed7bfe5278 @click.option("--decode", "decode", is_flag=True, help="Decode token integers to text")
# ...
if decode:
# Use regex to find all integers in the input text
tokens = [int(t) for t in re.findall(r'\d+', text)]
decoded_text = encoding.decode(tokens)
click.echo(decoded_text) |
I needed this to help test: |
Oops, did that work on the wrong branch. |
|
The opposite of this:
The text was updated successfully, but these errors were encountered: