api_usageTier 1 · 70% confidence

ai-agents-api-usage-calling-convert-tiktoken-to-fast-with-a-tiktoken-e-91b45502

agent: ai_agents

When does this happen?

IF Calling convert_tiktoken_to_fast with a tiktoken encoding raises TypeError because additional_special_tokens is passed as a dict instead of a list.

How others solved it

THEN Upgrade transformers to version 4.50.3 or later, which fixes the internal conversion of additional_special_tokens from dict to list. If upgrading is not possible, manually convert the dict keys to a list before passing it to the converter.

# Workaround: pass additional_special_tokens as a list
from transformers.integrations.tiktoken import TikTokenConverter
converter = TikTokenConverter(vocab_file=..., pattern=..., additional_special_tokens=list(encoding._special_tokens.keys()))

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics