You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
TypeError in metric.evaluate() when called directly.
When the evaluate() method of a metric (derived from BaseMetric) is called directly (without first calling measure()), it throws a TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int/float'. This is because the evaluation_cost attribute in the BaseMetric class is initialized to None.
During the evaluation process, the code attempts to increment evaluation_cost (e.g., evaluation_cost += cost). However, since evaluation_cost is None by default, this operation results in the TypeError.
Expected Behavior: evaluation_cost should be initialized to 0 to allow numerical additions.
To Reproduce
Steps to reproduce the behavior:
Instantiate a metric (e.g., metric = GEval()).
Call metric.evaluate(test_case) directly.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: iOS
Browser: Chrome
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
TypeError in metric.evaluate() when called directly.
When the evaluate() method of a metric (derived from BaseMetric) is called directly (without first calling measure()), it throws a TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int/float'. This is because the evaluation_cost attribute in the BaseMetric class is initialized to None.
During the evaluation process, the code attempts to increment evaluation_cost (e.g., evaluation_cost += cost). However, since evaluation_cost is None by default, this operation results in the TypeError.
Expected Behavior: evaluation_cost should be initialized to 0 to allow numerical additions.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: