MCPcopy Create free account
hub / github.com/huggingface/evaluate / __init__

Method __init__

src/evaluate/loading.py:446–462  ·  view source on GitHub ↗
(
        self,
        name: str,
        module_type: str = "metrics",
        revision: Optional[Union[str, Version]] = None,
        download_config: Optional[DownloadConfig] = None,
        download_mode: Optional[DownloadMode] = None,
        dynamic_modules_path: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

444 """Get the module of a metric from a metric repository on the Hub."""
445
446 def __init__(
447 self,
448 name: str,
449 module_type: str = "metrics",
450 revision: Optional[Union[str, Version]] = None,
451 download_config: Optional[DownloadConfig] = None,
452 download_mode: Optional[DownloadMode] = None,
453 dynamic_modules_path: Optional[str] = None,
454 ):
455 self.name = name
456 self.module_type = module_type
457 self.revision = revision
458 self.download_config = download_config or DownloadConfig()
459 self.download_mode = download_mode
460 self.dynamic_modules_path = dynamic_modules_path
461 assert self.name.count("/") == 1
462 increase_load_count(name, resource_type="metric")
463
464 def download_loading_script(self, revision) -> str:
465 file_path = hf_hub_url(path=self.name, name=self.name.split("/")[1] + ".py", revision=revision)

Callers

nothing calls this directly

Calls 1

increase_load_countFunction · 0.85

Tested by

no test coverage detected