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

binary incompatibility when running the Gemini example: Expected 96 from C header, got 88 from PyObject #204

Open
palladius opened this issue Nov 26, 2024 · 2 comments

Comments

@palladius
Copy link

Describe the bug

I've run the code in https://github.com/protectai/llm-guard/blob/main/examples/google_gemini.py in Google Colab

To Reproduce
Steps to reproduce the behavior:

  1. Create a python notebook with two pieces of code:
  2. first from here:
!pip install google-cloud-aiplatform --upgrade --user
!pip install llm-guard
  1. second from here: Go to https://github.com/protectai/llm-guard/blob/main/examples/google_gemini.py
  2. Put reasonable Project/region
  3. Execute first, reload env, execute second.
  4. See error

Expected behavior
Something good should happen - you tell me :)

Screenshots
If applicable, add screenshots to help explain your problem.
Coming in next comment

Additional context

See below

first error

First it said It was compiled with different version of numpy, so I've added this as suggested by Gemini:

!pip install --upgrade numpy

second error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-d5c52cca659e> in <cell line: 30>()
     28 
     29 # Import Scanners from LLM Guard
---> 30 from llm_guard import scan_output, scan_prompt
     31 from llm_guard.input_scanners import PromptInjection, TokenLimit, Toxicity
     32 from llm_guard.output_scanners import NoRefusal, Relevance, Sensitive

14 frames
/usr/local/lib/python3.10/dist-packages/thinc/backends/numpy_ops.pyx in init thinc.backends.numpy_ops()

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

image

@palladius
Copy link
Author

First error - hopefully fixed by updating numpy (maybe exacerbated?)

image

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

No branches or pull requests

1 participant