nvflare.app_common.model_locator.list_model_locator module

class ListModelLocator(persistor_id: str, model_list={})[source]

Bases: ModelLocator

The ModelLocator’s job is to find and locate the models inventory saved during training.

Parameters:
  • persistor_id (str) – ModelPersistor component ID

  • model_list – a list of model_names and locations

get_model_names(fl_ctx: FLContext) List[str][source]

Returns the list of model names that should be included from server in cross site validation.add().

Parameters:

fl_ctx (FLContext) – FL Context object.

Returns:

List of model names.

Return type:

List[str]

handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters:
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

locate_model(model_name, fl_ctx: FLContext) DXO[source]

Call to locate and load the model weights of model_name.

Parameters:
  • model_name – name of the model

  • fl_ctx – FLContext

Returns: model_weight DXO