Skip to content

Commit

Permalink
Fix FLModelUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanTingHsieh committed Jan 17, 2024
1 parent 9a7942e commit 4cb45fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nvflare/app_common/utils/fl_model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def from_shareable(shareable: Shareable, fl_ctx: Optional[FLContext] = None) ->
params = None
meta = {}

try:
submit_model_name = shareable.get_header(AppConstants.SUBMIT_MODEL_NAME)
if submit_model_name:
# this only happens in cross-site eval right now
meta[MetaKey.SUBMIT_MODEL_NAME] = submit_model_name
else:
dxo = from_shareable(shareable)
meta = dict(dxo.meta)
if dxo.data_kind == DataKind.METRICS:
Expand All @@ -115,10 +119,6 @@ def from_shareable(shareable: Shareable, fl_ctx: Optional[FLContext] = None) ->

if MetaKey.INITIAL_METRICS in meta:
metrics = meta[MetaKey.INITIAL_METRICS]
except:
# this only happens in cross-site eval right now
submit_model_name = shareable.get_header(AppConstants.SUBMIT_MODEL_NAME)
meta[MetaKey.SUBMIT_MODEL_NAME] = submit_model_name

current_round = shareable.get_header(AppConstants.CURRENT_ROUND, None)
total_rounds = shareable.get_header(AppConstants.NUM_ROUNDS, None)
Expand Down

0 comments on commit 4cb45fd

Please sign in to comment.