fix: relax tokenizers version constraint to support transformers 4.51+

This commit addresses issue #4268 where crewAI's restrictive tokenizers
constraint (using ~= operator) prevented using recent versions of
transformers (4.51+) which require tokenizers >= 0.21.

Changes:
- Changed tokenizers constraint from ~=0.20.3 to >=0.20.3
- Added test to verify the constraint remains flexible

The ~= operator was too restrictive as it only allows patch version
updates (tokenizers~=0.20.3 means >=0.20.3,<0.21.0). This caused
dependency resolution failures when installing transformers 4.51+.

crewAI does not directly import or use tokenizers - it is a transitive
dependency. chromadb only requires tokenizers>=0.13.2 with no upper
bound, so relaxing this constraint is safe.

Fixes #4268

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2026-01-23 07:51:22 +00:00
parent bd4d039f63
commit 7564d71163
2 changed files with 52 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ dependencies = [
"opentelemetry-exporter-otlp-proto-http~=1.34.0",
# Data Handling
"chromadb~=1.1.0",
"tokenizers~=0.20.3",
"tokenizers>=0.20.3",
"openpyxl~=3.1.5",
# Authentication and Security
"python-dotenv~=1.1.1",