Upload metric.py with huggingface_hub
Browse files
metric.py
CHANGED
|
@@ -19,6 +19,7 @@ from .formats import __file__ as _
|
|
| 19 |
from .fusion import __file__ as _
|
| 20 |
from .generator_utils import __file__ as _
|
| 21 |
from .hf_utils import __file__ as _
|
|
|
|
| 22 |
from .instructions import __file__ as _
|
| 23 |
from .loaders import __file__ as _
|
| 24 |
from .logging_utils import __file__ as _
|
|
@@ -79,14 +80,7 @@ class Metric(evaluate.Metric):
|
|
| 79 |
split_name: str = "all",
|
| 80 |
):
|
| 81 |
if is_package_installed("unitxt"):
|
| 82 |
-
|
| 83 |
-
get_constants as installed_get_constants
|
| 84 |
-
|
| 85 |
-
installed_package_constants = installed_get_constants()
|
| 86 |
-
if installed_package_constants.version != self.VERSION:
|
| 87 |
-
raise ValueError(
|
| 88 |
-
f"Located installed unitxt version {installed_get_constants.version} that is different then unitxt metric version {self.VERSION}. Please make sure the installed version is identical to the dataset version."
|
| 89 |
-
)
|
| 90 |
|
| 91 |
from unitxt.metric_utils import _compute as _compute_installed
|
| 92 |
|
|
|
|
| 19 |
from .fusion import __file__ as _
|
| 20 |
from .generator_utils import __file__ as _
|
| 21 |
from .hf_utils import __file__ as _
|
| 22 |
+
from .hf_utils import verify_versions_compatibility
|
| 23 |
from .instructions import __file__ as _
|
| 24 |
from .loaders import __file__ as _
|
| 25 |
from .logging_utils import __file__ as _
|
|
|
|
| 80 |
split_name: str = "all",
|
| 81 |
):
|
| 82 |
if is_package_installed("unitxt"):
|
| 83 |
+
verify_versions_compatibility("metric", self.VERSION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
from unitxt.metric_utils import _compute as _compute_installed
|
| 86 |
|