Skip to content

Dependency issue #29

Description

@nguyen-duchau
  • ferret version: 0.4.1
  • Python version: 3.9
  • Operating System: MacOS

Description

I'm following the getting started of ferret framework on macOS and counter several technical issues (due to versioning).

What I Did

from transformers import AutoModelForSequenceClassification, AutoTokenizer
from ferret import Benchmark

name = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
model = AutoModelForSequenceClassification.from_pretrained(name)
tokenizer = AutoTokenizer.from_pretrained(name)

First of all, the 5th line of code has a problem with protobuf version. But this is related to huggingface so I'll ignore this issue.

bench = Benchmark(model, tokenizer)
explanations = bench.explain("You look stunning!", target=1)

The issue comes the 7th line, where it seems that the package is using a numpy version that is incompatible.

AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

I don't understand why this issue came in. The numpy is within the package, it should be compatible. I didn't install it from elsewhere.

Potential suggestion

Maybe we should precise environment version in the documentation ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions