Skip to content

core.models.model_collection

model_collection

Classes:

Name Description
ModelCollection

A collection for managing multiple models, with one active loaded model at a time.

ModelCollection(models)

Bases: Generic[TModel]

A collection for managing multiple models, with one active loaded model at a time.

Provides access to individual models by name, and supports downloading weights for all models in the collection.

Parameters:

Name Type Description Default

models

list[TModel]

List of model instances.

required

Methods:

Name Description
set_loaded_model

Set the loaded model for this collection.

download_weights

Download weights for all models to subdirectories by model name.

Attributes:

Name Type Description
models
loaded_model Any

Return the currently loaded model.

models = {model.name: modelfor model in models} instance-attribute

loaded_model property

Return the currently loaded model.

set_loaded_model(model)

Set the loaded model for this collection.

download_weights(destination_dir)

Download weights for all models to subdirectories by model name.

Parameters:

Name Type Description Default
destination_dir
str

Base directory where weights will be saved.

required