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:

SimpleDocker

is_docker_installed()[source]

Check if Docker is installed.

is_docker_active()[source]

Check if Docker is active.

is_available(model_id)[source]

Check if the model is available locally or on DockerHub.

write_apis(model_id)[source]

Write APIs for the model.

copy_information(model_id)[source]

Copy the information file from the model container.

copy_metadata(model_id)[source]

Copy the metadata file from the model container.

copy_status(model_id)[source]

Copy the status file from the model container.

copy_example_if_available(model_id)[source]

Copy example files from the model container if available.

modify_information(model_id)[source]

Modify the information file copied from the model container.

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

async modify_information(model_id: str)[source]

Modify the information file copied from the model directory.

Parameters:

model_id (str) – ID of the model.

async write_apis(model_id: str)[source]

Write APIs for the model.

Parameters:

model_id (str) – ID of the model.

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

is_available(model_id)[source]

Check if the model is available at the hosted URL.

write_apis(model_id)[source]

Write APIs for the model.

get_information(model_id)[source]

Get information for the model.

get_metadata(model_id)[source]

Get metadata for the model.

write_status(model_id)[source]

Write the status file for the model.

fetch(model_id)[source]

Fetch the model from the hosted URL.

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

write_apis(model_id: str)[source]

Write APIs for the model.

Parameters:

model_id (str) – ID of the model.

write_status(model_id: str)[source]

Write the status file for the model.

Parameters:

model_id (str) – ID of the model.

Module contents