class_docstr: Base class for model wrapper.
  
  Args:
      path: The path to the model.
      model_max_length: The maximum sequence length of the model.
      prompt_template: The model's prompt template.
      batch_size: Batch size for inference.
      logger: Logger for the model.
docstr: Get loss given batch and batch with target.
  Use their length difference after tokenization to mask the loss and only compute loss at target tokens.
  
  Args:
      batch: batch prompt without target answer.
      batch_target: batch prompt with target answer.
  
  Returns:
      A list of loss.
code: def get_loss(
      self, batch: List[str], batch_target: List[str]
  ) -> List[float]:
      """
      Get loss given batch and batch with target.
      Use their length difference after tokenization to mask the loss and only compute loss at target tokens.
  
      Args:
          batch: batch prompt without target answer.
          batch_target: batch prompt with target answer.
  
      Returns:
          A list of loss.
      """
  
file_path: colossalai/applications/ColossalEval/colossal_eval/models/base.py
imports: from abc import abstractclassmethod
  from typing import Dict, List
  from colossal_eval.utils import Conversation, prompt_templates
  from colossalai.logging import DistributedLogger
label_desc: Use image node_id 4 for calling the BaseModel obj's underlying member method code with example usage: obj.get_loss(batch, batch_target) without return types