Skip to content

Commit 2631756

Browse files
fix
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
1 parent 32d0eae commit 2631756

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tutorials/02_NeMo_Adapters.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"import torch\n",
9494
"import torch.nn as nn\n",
9595
"from nemo.core import NeuralModule, ModelPT\n",
96-
"from nemo.core.classes.common import ALLOWED_TARGET_PREFIXES\n",
96+
"from nemo.core.classes.common import ALLOWED_TARGET_PREFIXES, ALLOWED_EXACT_CLASS_TARGETS\n",
9797
"\n",
9898
"from hydra.utils import instantiate\n",
9999
"from omegaconf import DictConfig, OmegaConf\n",
@@ -582,7 +582,11 @@
582582
"\n",
583583
" # Apply scaling factor. Equivalent to f(x) = scale * (x * adapter(x))\n",
584584
" result = self.scale * result\n",
585-
" return result\n"
585+
" return result\n",
586+
"\n",
587+
"_strategy_classpath = f'{MultiplicationAdapterStrategy.__module__}.{MultiplicationAdapterStrategy.__name__}'\n",
588+
"ALLOWED_TARGET_PREFIXES.append(_strategy_classpath)\n",
589+
"ALLOWED_EXACT_CLASS_TARGETS.add(_strategy_classpath)"
586590
]
587591
},
588592
{

0 commit comments

Comments
 (0)