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
Hi, I tried to run the following script by combining two metrics, but the error occurred:
Python3.9.16 (main, Apr52023, 13:58:15)
Type'copyright', 'credits'or'license'formoreinformationIPython8.18.1--AnenhancedInteractivePython. Type'?'forhelp.
In [1]: importevaluateIn [2]: evaluations= ("accuracy", "f1", "precision", "recall")
In [3]: clf_metrics=evaluate.combine(evaluations=evaluations)
---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
CellIn[3], line1---->1clf_metrics=evaluate.combine(evaluations=evaluations)
File~/.pyenv/versions/3.9.16/envs/my-dev/lib/python3.9/site-packages/evaluate/module.py:1034, incombine(evaluations, force_prefix)
1008defcombine(evaluations, force_prefix=False):
1009"""Combines several metrics, comparisons, or measurements into a single `CombinedEvaluations` object that 1010 can be used like a single evaluation module. 1011 (...) 1031 ``` 1032 """->1034returnCombinedEvaluations(evaluations, force_prefix=force_prefix)
File~/.pyenv/versions/3.9.16/envs/my-dev/lib/python3.9/site-packages/evaluate/module.py:884, inCombinedEvaluations.__init__(self, evaluation_modules, force_prefix)
881self.evaluation_module_names=list(evaluation_modules.keys())
882loaded_modules= []
-->884formoduleinself.evaluation_modules:
885ifisinstance(module, str):
886module=load(module)
AttributeError: 'CombinedEvaluations'objecthasnoattribute'evaluation_modules'
If we use a list format for evaluations, it works fine, but I think we should also support tuple format, which work in the same way as list. This can be easily achieved by modifying the following section.
Hi, I tried to run the following script by combining two metrics, but the error occurred:
If we use a list format for
evaluations
, it works fine, but I think we should also support tuple format, which work in the same way as list. This can be easily achieved by modifying the following section.https://github.com/huggingface/evaluate/blob/main/src/evaluate/module.py#L877
May I create a PR?
The text was updated successfully, but these errors were encountered: