g8a9/ferret

Dependency issue

Opened this issue · 3 comments

  • 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 ?

+1 for exact library versions

g8a9 commented

Hi! I appreciate the notice. Yes, we currently need robust requirement specifications (and dependency management and packaging, for what that matters). I will look into this during this week!

g8a9 commented

Hi @Kihansi95, can you provide the full error stack for both the lines you mention?