From d4b66613449123e84d93cc43c073a4bc53620664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yuan-Ting=20Hsieh=20=28=E8=AC=9D=E6=B2=85=E5=BB=B7=29?= Date: Tue, 30 Apr 2024 17:37:33 -0700 Subject: [PATCH] Fix decorator issue (#2542) --- nvflare/client/decorator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nvflare/client/decorator.py b/nvflare/client/decorator.py index e00e4423f5..4a8b47e890 100644 --- a/nvflare/client/decorator.py +++ b/nvflare/client/decorator.py @@ -27,7 +27,8 @@ def _replace_func_args(func, kwargs, model: FLModel): class ObjectHolder: - pass + def __init__(self): + self.metrics = None object_holder = ObjectHolder() @@ -71,7 +72,7 @@ def wrapper(*args, **kwargs): if object_holder.metrics is not None: return_value.metrics = object_holder.metrics - object_holder = None + object_holder = ObjectHolder() send(model=return_value)