Skip to content

RuntimeError(StackOverflow) with tiktoken.encoding_for_model('gpt-4').encode(txt, disallowed_special=()) #400

@sumitKpandey

Description

@sumitKpandey

Hi,

we are using tiktoken 0.5.2 to calculate the token count. It is working most of the time, but we are seeing the error: RuntimeError(StackOverflow) with one of the runs.

Here is the part of the stack trace:
SystemLog: File "/azureml-envs/azureml_40acd812113c64de92b8cc12dc98c336/lib/python3.11/site-packages/tiktoken/core.py", line 120, in encode
SystemLog: return self._core_bpe.encode(text, allowed_special)

I also checked the text size and it's pretty big (around 2 GB) is there any limitation on the size?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions