Skip to content

fix(jailbreak): pin numpy==1.23.5 for scikit-learn compatibility #1249

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

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

Pouyanpi
Copy link
Collaborator

Problem

The Docker build for the jailbreak detection heuristics server was failing with a binary incompatibility error:

ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

This error occurred during the step that pre downloads the GPT-2 model, when the transformers library tried to import scikit-learn, which had been compiled against a different version of numpy than what was present at runtime.

Root Cause

  • The requirements.txt had scikit-learn==1.2.2 pinned but no explicit numpy version constraint
  • during Docker build transformers and other deps pulled in a newer version of numpy
  • scikit-learn 1.2.2 was compiled against numpy 1.23.x series, but a newer numpy version was installed
  • this created a binary incompatibility between scikit-learn's C extensions and the runtime numpy version

@Pouyanpi Pouyanpi added this to the v0.14.1 milestone Jun 27, 2025
@Pouyanpi Pouyanpi added the bug Something isn't working label Jun 27, 2025
@Pouyanpi Pouyanpi self-assigned this Jun 27, 2025
@Pouyanpi
Copy link
Collaborator Author

related todo: #934

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.34%. Comparing base (c9cfa7e) to head (da6cfc7).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1249   +/-   ##
========================================
  Coverage    69.34%   69.34%           
========================================
  Files          161      161           
  Lines        15995    15995           
========================================
  Hits         11091    11091           
  Misses        4904     4904           
Flag Coverage Δ
python 69.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@erickgalinkin erickgalinkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pouyanpi Pouyanpi merged commit acc62c8 into develop Jun 27, 2025
39 checks passed
@Pouyanpi Pouyanpi deleted the fix/jailbreak-container branch June 27, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants