Skip to content

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

Open
@palladius

Description

@palladius

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions