MCPcopy Create free account
hub / github.com/huggingface/sentence-transformers / load

Method load

tests/base/test_model.py:2011–2033  ·  view source on GitHub ↗
(
        cls,
        model_name_or_path: str,
        subfolder: str = "",
        token: bool | str | None = None,
        cache_folder: str | None = None,
        revision: str | None = None,
        local_files_only: bool = False,
        trust_remote_code: bool = False,
        model_kwargs: dict | None = None,
        processor_kwargs: dict | None = None,
        config_kwargs: dict | None = None,
        backend: str = "torch",
    )

Source from the content-addressed store, hash-verified

2009
2010 @classmethod
2011 def load(
2012 cls,
2013 model_name_or_path: str,
2014 subfolder: str = "",
2015 token: bool | str | None = None,
2016 cache_folder: str | None = None,
2017 revision: str | None = None,
2018 local_files_only: bool = False,
2019 trust_remote_code: bool = False,
2020 model_kwargs: dict | None = None,
2021 processor_kwargs: dict | None = None,
2022 config_kwargs: dict | None = None,
2023 backend: str = "torch",
2024 ) -> StrictLoadModule:
2025 config = cls.load_config(
2026 model_name_or_path,
2027 subfolder=subfolder,
2028 token=token,
2029 cache_folder=cache_folder,
2030 revision=revision,
2031 local_files_only=local_files_only,
2032 )
2033 return cls(**config)
2034
2035
2036def test_modules_and_path_combo_warns_and_loads_from_path(caplog) -> None:

Callers

nothing calls this directly

Calls 1

load_configMethod · 0.45

Tested by

no test coverage detected