class_docstr: BLIP2 OPT model.
  Supported model types:
      - pretrained_opt2.7b: pretrained model with OPT2.7b
      - pretrained_opt6.7b: pretrained model with OPT6.7b
      - caption_coco_opt2.7b: fintuned image captioning model with OPT2.7b
      - caption_coco_opt6.7b: fintuned image captioning model with OPT6.7b
  Usage:
      >>> from lavis.models import load_model
      >>> model = load_model("blip2_opt", "caption_coco_opt2.7b")
class_docstr_tok: ["BLIP2","OPT","model",".","Supported","model","types",":","-","pretrained_opt2.7b",":","pretrained","model","with","OPT2.7b","-","pretrained_opt6.7b",":","pretrained","model","with","OPT6.7b","-","caption_coco_opt2.7b",":","fintuned","image","captioning","model","with","OPT2.7b","-","caption_coco_opt6.7b",":","fintuned","image","captioning","model","with","OPT6.7b","Usage",":",">",">",">","from","lavis.models","import","load_model",">",">",">","model","=","load_model","(","``","blip2_opt","''",",","``","caption_coco_opt2.7b","''",")"]
code: def lemmatizer(self):
      if self._lemmatizer is None:
          try:
              import spacy
  
              self._lemmatizer = spacy.load("en_core_web_sm")
          except ImportError:
              logging.error(
                  """
                      Please install spacy and en_core_web_sm model to apply lemmatization.
                      python -m spacy download en_core_web_sm
                      OR
                      import spacy.cli
                      spacy.cli.download("en_core_web_sm")
                      """
              )
              exit(1)
  
      return self._lemmatizer
  
file_path: lavis/lavis/models/blip2_models/blip2_opt.py
imports: import logging
  from packaging import version
  import torch
  from torch.cuda.amp import autocast
  import torch.nn
  from lavis.common.registry import registry
  from lavis.models.blip2_models.blip2 import Blip2Base, disabled_train
  from transformers import AutoTokenizer, OPTForCausalLM, OPTConfig
  import transformers
label_desc: Use image node_id 6 for calling the Blip2OPT obj's underlying member method code with example usage: obj.lemmatizer() and returns: self