From 71e36fb35ff97a20522aac0b0904c266ffb5c418 Mon Sep 17 00:00:00 2001 From: Hemil Desai Date: Wed, 17 Jul 2024 16:22:41 -0700 Subject: [PATCH] Fix bug in factory Signed-off-by: ashors1 --- nemo/collections/llm/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nemo/collections/llm/utils.py b/nemo/collections/llm/utils.py index b4382d0afd5f..5c087f60590a 100644 --- a/nemo/collections/llm/utils.py +++ b/nemo/collections/llm/utils.py @@ -42,9 +42,8 @@ def factory(*args: Any, **kwargs: Any) -> Union[Callable[[T], T], T]: try: import nemo_sdk as sdk - if not args and not kwargs: - # Used as @factory without arguments - return sdk.factory() + if not args: + return sdk.factory(**kwargs) else: # Used as @factory(*args, **kwargs) return sdk.factory(*args, **kwargs)