ersilia.hub.fetch package¶
Subpackages¶
- ersilia.hub.fetch.actions package
- Submodules
- ersilia.hub.fetch.actions.check module
- ersilia.hub.fetch.actions.content module
- ersilia.hub.fetch.actions.get module
- ersilia.hub.fetch.actions.inform module
- ersilia.hub.fetch.actions.lake module
- ersilia.hub.fetch.actions.modify module
- ersilia.hub.fetch.actions.pack_bentoml module
- ersilia.hub.fetch.actions.pack_fastapi module
- ersilia.hub.fetch.actions.prepare module
- ersilia.hub.fetch.actions.setup module
- ersilia.hub.fetch.actions.sniff_bentoml module
- ersilia.hub.fetch.actions.sniff_fastapi module
- ersilia.hub.fetch.actions.template_resolver module
- ersilia.hub.fetch.actions.toolize module
- Module contents
- ersilia.hub.fetch.lazy_fetchers package
- Submodules
- ersilia.hub.fetch.lazy_fetchers.dockerhub module
ModelDockerHubFetcher
ModelDockerHubFetcher.overwrite
ModelDockerHubFetcher.config_json
ModelDockerHubFetcher.simple_docker
ModelDockerHubFetcher.is_docker_installed()
ModelDockerHubFetcher.is_docker_active()
ModelDockerHubFetcher.is_available()
ModelDockerHubFetcher.write_apis()
ModelDockerHubFetcher.copy_information()
ModelDockerHubFetcher.copy_metadata()
ModelDockerHubFetcher.copy_status()
ModelDockerHubFetcher.copy_example_if_available()
ModelDockerHubFetcher.modify_information()
ModelDockerHubFetcher.fetch()
ModelDockerHubFetcher.copy_example_if_available()
ModelDockerHubFetcher.copy_information()
ModelDockerHubFetcher.copy_metadata()
ModelDockerHubFetcher.copy_status()
ModelDockerHubFetcher.fetch()
ModelDockerHubFetcher.is_available()
ModelDockerHubFetcher.is_docker_active()
ModelDockerHubFetcher.is_docker_installed()
ModelDockerHubFetcher.modify_information()
ModelDockerHubFetcher.write_apis()
- ersilia.hub.fetch.lazy_fetchers.hosted module
ModelHostedFetcher
ModelHostedFetcher.url
ModelHostedFetcher.config_json
ModelHostedFetcher.is_available()
ModelHostedFetcher.write_apis()
ModelHostedFetcher.get_information()
ModelHostedFetcher.get_metadata()
ModelHostedFetcher.write_status()
ModelHostedFetcher.fetch()
ModelHostedFetcher.fetch()
ModelHostedFetcher.get_information()
ModelHostedFetcher.get_metadata()
ModelHostedFetcher.is_available()
ModelHostedFetcher.write_apis()
ModelHostedFetcher.write_status()
- Module contents
- ersilia.hub.fetch.pack package
- ersilia.hub.fetch.register package
Submodules¶
ersilia.hub.fetch.fetch module¶
- class ersilia.hub.fetch.fetch.FetchResult(fetch_success, reason)¶
Bases:
tuple
- fetch_success¶
Alias for field number 0
- reason¶
Alias for field number 1
- class ersilia.hub.fetch.fetch.ModelFetcher(config_json: dict | None = None, credentials_json: dict | None = None, overwrite: bool | None = None, repo_path: str | None = None, mode: str | None = None, pip: bool = False, dockerize: bool = False, force_from_github: bool = False, force_from_s3: bool = False, force_from_dockerhub: bool = False, img_version: str | None = None, force_from_hosted: bool = False, force_with_bentoml: bool = False, force_with_fastapi: bool = False, hosted_url: str | None = None, local_dir: str | None = None)[source]¶
Bases:
ErsiliaBase
ModelFetcher is responsible for fetching models from various sources.
- Parameters:
config_json (dict, optional) – Configuration settings for the fetcher.
credentials_json (dict, optional) – Credentials for accessing the model hub.
overwrite (bool, optional) – Whether to overwrite existing files.
repo_path (str, optional) – Path to the repository.
mode (str, optional) – Mode of operation, e.g., ‘docker’.
pip (bool, optional) – Whether to use pip for installation.
dockerize (bool, optional) – Whether to dockerize the model.
force_from_github (bool, optional) – Whether to force fetching from GitHub.
force_from_s3 (bool, optional) – Whether to force fetching from S3.
force_from_dockerhub (bool, optional) – Whether to force fetching from DockerHub.
img_version (str, optional) – Version of the model image.
force_from_hosted (bool, optional) – Whether to force fetching from hosted services.
force_with_bentoml (bool, optional) – Whether to force fetching with BentoML.
force_with_fastapi (bool, optional) – Whether to force fetching with FastAPI.
hosted_url (str, optional) – URL for hosted model.
local_dir (str, optional) – Local directory for the model.
Examples
fetcher = ModelFetcher(config_json=config) await fetcher.fetch(model_id="eosxxxx")
- exists(model_id: str) bool [source]¶
Check if the model exists locally.
- Parameters:
model_id (str) – The ID of the model to be checked.
- Returns:
True if the model exists locally, False otherwise.
- Return type:
bool
- async fetch(model_id: str) bool [source]¶
Fetch a model with the given eos identifier.
- Parameters:
model_id (str) – The eos identifier of the model.
- Returns:
True if the model was fetched successfully, False otherwise.
- Return type:
bool
Examples
fetcher = ModelFetcher(config_json=config) success = await fetcher.fetch(model_id="eosxxxx")
ersilia.hub.fetch.fetch_bentoml module¶
Fetch model from the Ersilia Model Hub using BentoML.
- class ersilia.hub.fetch.fetch_bentoml.ModelFetcherFromBentoML(config_json: dict | None = None, credentials_json: dict | None = None, overwrite: bool | None = None, repo_path: str | None = None, mode: str | None = None, pip: bool = False, dockerize: bool = False, force_from_github: bool = False, force_from_s3: bool = False)[source]¶
Bases:
ErsiliaBase
ModelFetcherFromBentoML is responsible for fetching models from the Ersilia Model Hub using BentoML.
- Parameters:
config_json (dict, optional) – Configuration settings for the fetcher.
credentials_json (dict, optional) – Credentials for accessing the model hub.
overwrite (bool, optional) – Whether to overwrite existing files.
repo_path (str, optional) – Path to the repository.
mode (str, optional) – Mode of operation, e.g., ‘docker’.
pip (bool, optional) – Whether to use pip for installation.
dockerize (bool, optional) – Whether to dockerize the model.
force_from_github (bool, optional) – Whether to force fetching from GitHub.
force_from_s3 (bool, optional) – Whether to force fetching from S3.
Examples
fetcher = ModelFetcherFromBentoML( config_json=config ) fetcher.fetch(model_id="eosxxxx")
ersilia.hub.fetch.fetch_fastapi module¶
Fetch model from the Ersilia Model Hub using FastAPI.
- class ersilia.hub.fetch.fetch_fastapi.ModelFetcherFromFastAPI(config_json: dict | None = None, credentials_json: dict | None = None, overwrite: bool | None = None, repo_path: str | None = None, mode: str | None = None, force_from_github: bool = False, force_from_s3: bool = False)[source]¶
Bases:
ErsiliaBase
ModelFetcherFromFastAPI is responsible for fetching models from the Ersilia Model Hub using FastAPI.
- Parameters:
config_json (dict, optional) – Configuration settings for the fetcher.
credentials_json (dict, optional) – Credentials for accessing the model hub.
overwrite (bool, optional) – Whether to overwrite existing files.
repo_path (str, optional) – Path to the repository.
mode (str, optional) – Mode of operation, e.g., ‘docker’.
force_from_github (bool, optional) – Whether to force fetching from GitHub.
force_from_s3 (bool, optional) – Whether to force fetching from S3.
Examples
fetcher = ModelFetcherFromFastAPI( config_json=config ) fetcher.fetch(model_id="eosxxxx")
Module contents¶
- class ersilia.hub.fetch.ModelURLResolver(model_id, config_json=None, credentials_json=None)[source]¶
Bases:
ErsiliaBase
Class to resolve the URL of a model.
This class provides methods to resolve the URL of a model based on its ID.
- Parameters:
model_id (str) – The ID of the model.
config_json (dict, optional) – Configuration settings in JSON format.
credentials_json (dict, optional) – Credentials settings in JSON format.