Skip to content

Commit

Permalink
Fixed the FOBS lazy loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nvidianz committed Dec 21, 2024
1 parent 5e90260 commit 3d5d97f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions nvflare/fuel/utils/fobs/fobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,10 @@ def _get_type_name(cls: Type) -> str:

def _load_class(type_name: str):
try:
parts = type_name.split(".")
if len(parts) == 1:
parts = ["builtins", type_name]
module_name, class_name = type_name.rsplit('.', 1)
module = importlib.import_module(module_name)

mod = __import__(parts[0])
for comp in parts[1:]:
mod = getattr(mod, comp)

return mod
return getattr(module, class_name)
except Exception as ex:
raise TypeError(f"Can't load class {type_name}: {ex}")

Expand Down

0 comments on commit 3d5d97f

Please sign in to comment.