class_docstr: Generic PyTorch-Lightning class that must be initialized with a PyTorch module.
class_docstr_tok: ["Generic","PyTorch-Lightning","class","that","must","be","initialized","with","a","PyTorch","module","."]
code: def __init__(self, model, device, args):
      super().__init__()
      self.model = model
      self.cur_model = (
          model.module if hasattr(model, "module") else model
      )
      self.device = device
      self.args = args
  
      optimizer = self.args.get("optimizer", OPTIMIZER)
      self.optimizer_class = getattr(torch.optim, optimizer)
      self.lr = self.args.get("lr", LR)
  
file_path: DeepKE/src/deepke/relation_extraction/few_shot/lit_models/base.py
imports: import torch
  from transformers.optimization import get_linear_schedule_with_warmup
  from torch import nn
label_desc: Use image node_id 1 to create a new BaseLitModel object from inherited base classes: nn with example: obj = BaseLitModel(model, device, args)