ragas icon indicating copy to clipboard operation
ragas copied to clipboard

division by zero when computing output score

Open theoden8 opened this issue 1 year ago • 2 comments

Good time of the day,

Here https://github.com/explodinggradients/ragas/blob/main/src/ragas/testset/filters.py#L60 is a division by zero, which I encounter when using ragas with ollama+llama3-8b.

To solve it, I can replace:

output["score"] = sum(output.values()) / len(output.values())

Keeps failing at the final stage. Can be fixed with

if len(output.values()) == 0:
    output['score'] = .0
else:
    output["score"] = sum(output.values()) / len(output.values())

theoden8 avatar May 25 '24 09:05 theoden8

Hello! I'm facing the same issue. Any updates on this so far?

eugene-iacovciuc avatar Sep 23 '24 10:09 eugene-iacovciuc

any update ?

Ahmed-Ghazouani avatar Apr 04 '25 01:04 Ahmed-Ghazouani

Closing this as resolved.

Use TestsetGenerator in the new version.

anistark avatar Oct 28 '25 12:10 anistark