ersilia.hub.fetch.lazy_fetchers package¶
Submodules¶
ersilia.hub.fetch.lazy_fetchers.dockerhub module¶
- class ersilia.hub.fetch.lazy_fetchers.dockerhub.ModelDockerHubFetcher(overwrite=None, config_json=None, img_tag=None)[source]¶
Bases:
ErsiliaBase
A class used to fetch models from DockerHub.
- overwrite¶
Flag to indicate whether to overwrite existing files.
- Type:
bool
- config_json¶
Configuration settings in JSON format.
- Type:
dict
- simple_docker¶
Instance of SimpleDocker for Docker operations.
- Type:
- copy_example_if_available(model_id)[source]¶
Copy example files from the model container if available.
- fetch(model_id)¶
Fetch the model from DockerHub.
- async copy_example_if_available(model_id: str)[source]¶
Copy example files from the model container if available.
- Parameters:
model_id (str) – ID of the model.
- async copy_information(model_id: str)[source]¶
Copy the information file from the model container.
- Parameters:
model_id (str) – ID of the model.
- async copy_metadata(model_id: str)[source]¶
Copy the metadata file from the model container.
- Parameters:
model_id (str) – ID of the model.
- async copy_status(model_id: str)[source]¶
Copy the status file from the model container.
- Parameters:
model_id (str) – ID of the model.
- fetch(**kwargs)¶
- is_available(model_id: str) bool [source]¶
Check if the model is available locally or on DockerHub.
- Parameters:
model_id (str) – ID of the model to check.
- Returns:
True if the model is available, False otherwise.
- Return type:
bool
- is_docker_active() bool [source]¶
Check if Docker is active.
- Returns:
True if Docker is active, False otherwise.
- Return type:
bool
- is_docker_installed() bool [source]¶
Check if Docker is installed.
- Returns:
True if Docker is installed, False otherwise.
- Return type:
bool
ersilia.hub.fetch.lazy_fetchers.hosted module¶
- class ersilia.hub.fetch.lazy_fetchers.hosted.ModelHostedFetcher(url: str, config_json: dict | None = None)[source]¶
Bases:
ErsiliaBase
A class used to fetch models from a hosted URL.
- url¶
URL where the model is hosted.
- Type:
str
- config_json¶
Configuration settings in JSON format.
- Type:
dict
- fetch(model_id: str)[source]¶
Fetch the model from the hosted URL.
- Parameters:
model_id (str) – ID of the model.
- get_information(model_id: str)[source]¶
Get information for the model.
- Parameters:
model_id (str) – ID of the model.
- get_metadata(model_id: str)[source]¶
Get metadata for the model.
- Parameters:
model_id (str) – ID of the model.
- is_available(model_id: str) bool [source]¶
Check if the model is available at the hosted URL.
- Parameters:
model_id (str) – ID of the model to check.
- Returns:
True if the model is available, False otherwise.
- Return type:
bool