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

Code is not working as expected #1

Open
san360 opened this issue May 2, 2023 · 1 comment
Open

Code is not working as expected #1

san360 opened this issue May 2, 2023 · 1 comment

Comments

@san360
Copy link

san360 commented May 2, 2023

I tried to run the code in my environment and its not working as expected. It fails with multiple errors. can you quickly check and suggest? It fails for index creation with below error

ValueError: Encountered text corresponding to disallowed special token '<|endoftext|>'. If you want this text to be encoded as a special token, pass it to allowed_special, e.g. allowed_special={'<|endoftext|>', ...}. If you want this text to be encoded as normal text, disable the check for this token by passing disallowed_special=(enc.special_tokens_set - {'<|endoftext|>'}). To disable this check for all special tokens, pass disallowed_special=().

@shashnkvats
Copy link
Owner

shashnkvats commented May 2, 2023

Hi @san360,
Thanks for pointing this out! There seems to be some issue with the tiktoken library used by langchain that was causing it which you can also see here
Adding disallowed_special=() parameter to OpenAIEmbeddings() function fixes it.

Additionally, you might also need to upgrade jinja2 and typing-extentions libraries.

pip install --upgrade jinja2
pip install --upgrade typing-extentions

Cheers,
Shashank

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

2 participants