Skip to content

Commit

Permalink
fix possible issue with default list values
Browse files Browse the repository at this point in the history
Signed-off-by: Ananth Subramaniam <[email protected]>
  • Loading branch information
ananthsub committed Nov 20, 2024
1 parent 4e56c40 commit 8d09d46
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nemo/collections/diffusion/encoders/conditioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Union
from typing import List, Optional, Union

import torch
import torch.nn as nn
from transformers import CLIPTextModel, CLIPTokenizer, T5EncoderModel, T5Tokenizer


class AbstractEmbModel(nn.Module):
def __init__(self, enable_lora_finetune=False, target_block=[], target_module=[]):
def __init__(
self,
enable_lora_finetune: bool = False,
target_block: Optional[List[str]] = None,
target_module: Optional[List[str]] = None,
) -> None:
super().__init__()
self._is_trainable = None
self._ucg_rate = None
self._input_key = None

self.TARGET_BLOCK = target_block
self.TARGET_MODULE = target_module
self.TARGET_BLOCK = target_block or []
self.TARGET_MODULE = target_module or []
if enable_lora_finetune:
self.lora_layers = []

Expand Down

0 comments on commit 8d09d46

Please sign in to comment.