class_docstr: BLIP captioning model.
  
  Supported model types:
      - base_coco: fine-tuned BLIP base model on COCO caption dataset (Karparthy split).
      - large_coco: fine-tuned BLIP large model on COCO caption dataset (Karparthy split).
  
  Usage:
      >>> from lavis.models import load_model
      >>> model = load_model("blip_caption", "base_coco")
      >>> model = load_model("blip_caption", "large_coco")
class_docstr_tok: ["BLIP","captioning","model",".","Supported","model","types",":","-","base_coco",":","fine-tuned","BLIP","base","model","on","COCO","caption","dataset","(","Karparthy","split",")",".","-","large_coco",":","fine-tuned","BLIP","large","model","on","COCO","caption","dataset","(","Karparthy","split",")",".","Usage",":",">",">",">","from","lavis.models","import","load_model",">",">",">","model","=","load_model","(","``","blip_caption","''",",","``","base_coco","''",")",">",">",">","model","=","load_model","(","``","blip_caption","''",",","``","large_coco","''",")"]
code: def from_config(cls, cfg):
      # vision encoder
      image_encoder = VisionTransformerEncoder.from_config(cfg)
      # text encoder + multimodal decoder
      text_decoder = XBertLMHeadDecoder.from_config(cfg)
  
      prompt = cfg.get("prompt", None)
      max_txt_len = cfg.get("max_txt_len", 40)
  
      model = cls(
          image_encoder,
          text_decoder,
          prompt=prompt,
          max_txt_len=max_txt_len,
      )
      model.load_checkpoint_from_config(cfg)
  
      return model
  
file_path: lavis/lavis/models/blip_models/blip_caption.py
imports: import torch
  from lavis.common.registry import registry
  from lavis.models.blip_models.blip import BlipBase
  from lavis.models.blip_models.blip_outputs import BlipOutput, BlipIntermediateOutput
  from lavis.models.med import XBertLMHeadDecoder
  from lavis.models.vit import VisionTransformerEncoder
label_desc: Use image node_id 6 for calling the BlipCaption obj's underlying member method code with example usage: obj.from_config(cls, cfg) and returns: model