Model Downloading¶
Examples on how to use download utils function are available in the SubstraFL examples.
Download a SubstraFL aggregated object at a given state:
- Parameters
client (substra.Client) – Substra client where to fetch the model from.
compute_plan_key (str) – Compute plan key to fetch the model from.
round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to
None
, the rank_idx will be used. (Defaults to None)rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to
None
, the last task (with the highest rank) will be used. (Defaults to None)
- Returns
The serialized aggregated instance fetch from the given state.
- Return type
Any
- substrafl.model_loading.download_algo_state(client: substra.sdk.client.Client, compute_plan_key: str, round_idx: Optional[int] = None, rank_idx: Optional[int] = None) Any ¶
Download a SubstraFL Algo instance at a given state:
- Parameters
client (substra.Client) – Substra client where to fetch the model from.
compute_plan_key (str) – Compute plan key to fetch the model from.
round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to
None
, the rank_idx will be used. (Defaults to None)rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to
None
, the last task (with the highest rank) will be used. (Defaults to None)
- Returns
The serialized algo instance fetch from the given state.
- Return type
Any
Download a SubstraFL shared object at a given state:
- Parameters
client (substra.Client) – Substra client where to fetch the model from.
compute_plan_key (str) – Compute plan key to fetch the model from.
round_idx (Optional[int], None) – Round of the strategy to fetch the model from. If set to
None
, the rank_idx will be used. (Defaults to None)rank_idx (Optional[int], None) – Rank of the strategy to fetch the model from. If set to
None
, the last task (with the highest rank) will be used. (Defaults to None)
- Returns
The serialized shared instance fetch from the given state.
- Return type
Any