code: def replace_lora_embedding(model, r=2, lora_alpha=1):
      """
      Function replacing Embeddings with LoRa ones recursively.
      Args:
          model:
          r: rank of matrix of the Low Rank layer
          lora_alpha: cf paper
      """
      for name, module in model.named_children():
          if len(list(module.children())) > 0:
              replace_lora_embedding(module, r, lora_alpha)
          if isinstance(module, nn.Embedding):
              model._modules[name] = Embedding(
                  module.num_embeddings,
                  module.embedding_dim,
                  r=r,
                  lora_alpha=lora_alpha,
                  padding_idx=module.padding_idx,
                  sparse=module.sparse,
              )
      return model
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import math
  from torch.utils.checkpoint import checkpoint
  from typing import Dict
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: replace_lora_embedding(model, r, lora_alpha) and returns: model