nvflare.app_common.np.np_model_locator module
- class NPModelLocator(model_dir='models', model_name: str | Dict[str, str] = 'server.npy')[source]
Bases:
ModelLocatorThe ModelLocator’s job is to find the models to be included for cross site evaluation located on server. This NPModelLocator finds and extracts “server” model that is saved during training.
- Parameters:
model_dir (str) – Directory to look for models in. Defaults to “models”. Only used when model_name contains relative paths.
model_name (Union[str, Dict[str, str]]) –
Name or path of the model(s). Defaults to “server.npy”. - If a string, treated as filename for the “server” model - If a dict, maps model identifiers to filenames/paths - Paths can be:
Relative: resolved as
<run_dir>/<model_dir>/<model_name>Absolute: used directly (e.g., “/path/to/pretrained.npy”)
- SERVER_MODEL_NAME = 'server'