Skip to content

Fix outlines task1706: pin transformers and tokenizers versions#39

Merged
akhatua2 merged 1 commit intocooperbench:mainfrom
AlienKevin:fix/outlines-t1706-deps
Mar 12, 2026
Merged

Fix outlines task1706: pin transformers and tokenizers versions#39
akhatua2 merged 1 commit intocooperbench:mainfrom
AlienKevin:fix/outlines-t1706-deps

Conversation

@AlienKevin
Copy link
Contributor

Summary

The outlines task1706 Dockerfile and runner.sh install transformers and tokenizers without version pins. With the latest releases (transformers>=5.0.0, tokenizers>=0.22), all tests that use the model_transformers fixture fail:

  • tokenizers>=0.22 turns the BPE.__init__ DeprecationWarning into a hard error, causing GPT2Tokenizer initialization to fail
  • transformers>=5.0.0 has a code path in _from_pretrained that calls import_protobuf_decode_error() inside an except clause, which raises ImportError when protobuf is not installed — even for non-protobuf tokenizers like GPT2

The pre-built Docker image (akhatua/cooperbench-dottxt-ai-outlines:task1706) ships with transformers==5.0.0 + tokenizers==0.22.2 and is affected by both issues — 8 of 9 tests error with DeprecationWarning / ImportError on every run.

Fix

Pin transformers<5 and tokenizers<0.21 in both the Dockerfile and runner.sh.

Verification

Built the fixed image locally and ran the full test suite against the oracle combined.patch:

  • Feature 4 tests: 9/9 passed
  • Feature 6 tests: 11/11 passed
  • Full end-to-end (merge + both features via runner.sh): reward=1

The pre-built image also needs to be rebuilt with these pins.

Test plan

  • Build fixed Docker image locally
  • Run feature 4 tests against oracle combined.patch → 9/9 passed
  • Run feature 6 tests against oracle combined.patch → 11/11 passed
  • Run full end-to-end test.sh (merge + both features) → reward=1
  • Confirm pre-built image (akhatua/cooperbench-dottxt-ai-outlines:task1706) reproduces the failure → 1 passed, 8 errors

The Dockerfile and runner.sh install transformers and tokenizers without
version pins. transformers>=5.0.0 combined with tokenizers>=0.22 breaks
the test suite in two ways:

1. tokenizers 0.22 turns the BPE.__init__ DeprecationWarning into a hard
   error, causing GPT2Tokenizer initialization to fail.
2. transformers 5.x has a code path in _from_pretrained that calls
   import_protobuf_decode_error() inside an except clause, which raises
   ImportError when protobuf is not installed — even for non-protobuf
   tokenizers like GPT2.

Pin transformers<5 and tokenizers<0.21 in both the Dockerfile and
runner.sh to restore compatibility. Verified locally: both feature 4 and
feature 6 tests pass (9/9 and 11/11) with the pinned versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@akhatua2
Copy link
Collaborator

Thanks Kevin! This looks great to me.

@akhatua2 akhatua2 merged commit f4a5608 into cooperbench:main Mar 12, 2026
3 checks passed
@AlienKevin
Copy link
Contributor Author

@akhatua2 do we need to rebuild and reupload akhatua/cooperbench-dottxt-ai-outlines:task1706?

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