Upload folder using huggingface_hub
Browse filesFiles changed (3)
- metrics.py+7-3
- task.py+10-4
- version.py+1-1
1165 unmodified lines116611671168116911701171117240 unmodified lines1213121412151216121712181219117 unmodified lines13371338133913401341134213431165 unmodified linesdef prepare(self):super().prepare()self.metric = evaluate.load(self.hf_metric_name)def compute(self,40 unmodified linesdef prepare(self):super().prepare()self._metric = evaluate.load(self.metric)def get_str_id(self, str):if str not in self.str_to_id:117 unmodified linesdef prepare(self):super().prepare()self._metric = evaluate.load(self.metric, "multilabel")def add_str_to_id(self, str):if str not in self.str_to_id:1165 unmodified lines11661167116811691170117111721173117440 unmodified lines1215121612171218121912201221117 unmodified lines1339134013411342134313441345134613471165 unmodified linesdef prepare(self):super().prepare()self.metric = evaluate.load(self.hf_metric_name, experiment_id=str(uuid.uuid4()))def compute(self,40 unmodified linesdef prepare(self):super().prepare()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 linesdef prepare(self):super().prepare()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:
12371 unmodified lines75767778798081828384857 unmodified lines93949596979899from typing import Any, Dict, List, Optional, Unionfrom .artifact import fetch_artifact71 unmodified linesaugmentable_input in self.inputs), f"augmentable_input {augmentable_input} is not part of {self.inputs}"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()if (prediction_type == metric_prediction_type7 unmodified linescontinueraise ValueError(f"The task's prediction type ({prediction_type}) and '{metric_name}' "f"metric's prediction type ({metric_prediction_type}) are different.")123471 unmodified lines767778798081828384858687888990917 unmodified lines99100101102103104105from functools import lru_cachefrom typing import Any, Dict, List, Optional, Unionfrom .artifact import fetch_artifact71 unmodified linesaugmentable_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_id in self.metrics:metric_prediction_type = FormTask.get_metric_prediction_type(metric_id)if (prediction_type == metric_prediction_type7 unmodified linescontinueraise ValueError(f"The task's prediction type ({prediction_type}) and '{metric_id}' "f"metric's prediction type ({metric_prediction_type}) are different.")
1version = "1.8.0"1version = "1.8.1"
metrics.py+7-3
task.py+10-4
version.py+1-1