code: def prepare_model_weights(model, unfreeze_modules):
      if unfreeze_modules != "all":
          model.freeze()  # freeze everything
          logging.info(
              "module freezed, about to unfreeze modules to be trained"
          )
          if "dur" in unfreeze_modules and hasattr(
              model.model, "dur_pred_layer"
          ):
              logging.info("Training duration prediction")
              unfreeze(model.model.dur_pred_layer)
          if "f0" in unfreeze_modules and hasattr(
              model.model, "f0_pred_module"
          ):
              logging.info("Training F0 prediction")
              unfreeze(model.model.f0_pred_module)
          if "energy" in unfreeze_modules and hasattr(
              model.model, "energy_pred_module"
          ):
              logging.info("Training energy prediction")
              unfreeze(model.model.energy_pred_module)
          if "vpred" in unfreeze_modules and hasattr(
              model.model, "v_pred_module"
          ):
              logging.info("Training voiced prediction")
              unfreeze(model.model.v_pred_module)
              if hasattr(model, "v_embeddings"):
                  logging.info("Training voiced embeddings")
                  unfreeze(model.model.v_embeddings)
          if "unvbias" in unfreeze_modules and hasattr(
              model.model, "unvoiced_bias_module"
          ):
              logging.info("Training unvoiced bias")
              unfreeze(model.model.unvoiced_bias_module)
      else:
          logging.info("Training everything")
  
file_path: NeMo/examples/tts/radtts.py
imports: import pytorch_lightning
  from nemo.collections.common.callbacks import LogEpochTimeCallback
  from nemo.collections.tts.models.radtts import RadTTSModel
  from nemo.core.config import hydra_runner
  from nemo.utils import logging
  from nemo.utils.exp_manager import exp_manager
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_model_weights(model, unfreeze_modules) without return types