Upload folder using huggingface_hub
Browse filesFiles changed (3)
- metrics.py+7-3
- task.py+10-4
- version.py+1-1
1165 unmodified lines116611671168116911691170117111721173117440 unmodified lines12151216121712161218121912201221117 unmodified lines13391340134113401342134313441345134613471165 unmodified lines
def prepare(self): super().prepare() self.metric = evaluate.load(self.hf_metric_name) self.metric = evaluate.load( self.hf_metric_name, experiment_id=str(uuid.uuid4()) )
def compute( self,40 unmodified lines
def prepare(self): super().prepare() self._metric = evaluate.load(self.metric) self._metric = evaluate.load(self.metric, experiment_id=str(uuid.uuid4()))
def get_str_id(self, str): if str not in self.str_to_id:117 unmodified lines
def prepare(self): super().prepare() self._metric = evaluate.load(self.metric, "multilabel") self._metric = evaluate.load( self.metric, "multilabel", experiment_id=str(uuid.uuid4()) )
def add_str_to_id(self, str): if str not in self.str_to_id:123471 unmodified lines767778798081828384858680818287888990917 unmodified lines9910010196102103104105from functools import lru_cachefrom typing import Any, Dict, List, Optional, Union
from .artifact import fetch_artifact71 unmodified lines augmentable_input in self.inputs ), f"augmentable_input {augmentable_input} is not part of {self.inputs}"
@staticmethod @lru_cache(maxsize=None) def get_metric_prediction_type(metric_id: str): metric = fetch_artifact(metric_id)[0] return metric.get_prediction_type()
def check_metrics_type(self) -> None: prediction_type = parse_type_string(self.prediction_type) for metric_name in self.metrics: metric = fetch_artifact(metric_name)[0] metric_prediction_type = metric.get_prediction_type() for metric_id in self.metrics: metric_prediction_type = FormTask.get_metric_prediction_type(metric_id)
if ( prediction_type == metric_prediction_type7 unmodified lines continue
raise ValueError( f"The task's prediction type ({prediction_type}) and '{metric_name}' " f"The task's prediction type ({prediction_type}) and '{metric_id}' " f"metric's prediction type ({metric_prediction_type}) are different." )
11version = "1.8.0"version = "1.8.1"metrics.py+7-3
task.py+10-4
version.py+1-1