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

Disable special token restriction for claude ai #2310

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

xihajun
Copy link
Contributor

@xihajun xihajun commented Mar 3, 2024

<|endoftext|> is not the special token for claude ai

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Traceback (most recent call last):
  File "/Users/xihajun/Library/Python/3.9/lib/python/site-packages/litellm/main.py", line 1028, in completion
    response = anthropic.completion(
  File "/Users/xihajun/Library/Python/3.9/lib/python/site-packages/litellm/llms/anthropic.py", line 203, in completion
    encoding.encode(prompt)
  File "/Users/xihajun/Library/Python/3.9/lib/python/site-packages/tiktoken/core.py", line 117, in encode
    raise_disallowed_special_token(match.group())
  File "/Users/xihajun/Library/Python/3.9/lib/python/site-packages/tiktoken/core.py", line 400, in raise_disallowed_special_token
    raise ValueError(
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=()`.

Copy link

vercel bot commented Mar 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 3:51pm
litellm-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 3:51pm

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

Successfully merging this pull request may close these issues.

2 participants