huggingface / huggingface/evaluate

Getting error <lambda>() takes 0 positional arguments but 1 was given when trying to import evaluator

Open
#525 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.5k
Forks
341
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use evaluator in a Google Colab notebook, but I can't import it. I installed it with:
`!pip install evaluate[evaluator]`

Then trying importing it:
`from evaluate import evaluator` or simply `import evaluate`

But I'm getting this error when running the cell:
```TypeError Traceback (most recent call last)
[](https://localhost:8080/#) in ()
----> 1 from evaluate import evaluator
2 # perplexity = evaluate.load("perplexity", module_type="metric")
3 # input_texts = ["lorem ipsum", "Happy Birthday!", "Bienvenue"]
4
5 # results = perplexity.compute(model_id='google/flan-t5-base',

11 frames
[/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through)
2043 encoding = "utf-8"
2044 else:
-> 2045 encoding = locale.getpreferredencoding(False)
2046
2047 if not isinstance(encoding, str):

TypeError: () takes 0 positional arguments but 1 was given
```

Can anyone shine a light on it, please?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.