class_docstr: BLIP VQA models.
  
  Supported model types:
      - base: vqa model initialized with pre-trained BLIP base model on 115M image-text pairs after CapFilt; not fine-tuned.
      - vqav2: fine-tuned BLIP base model on VQA v2.0 dataset.
  
  Usage:
      >>> from lavis.models import load_model
      >>> model = load_model("blip_vqa", "vqav2")
      >>> model = load_model("blip_vqa", "okvqa")
      >>> model = load_model("blip_vqa", "aokvqa")
class_docstr_tok: ["BLIP","VQA","models",".","Supported","model","types",":","-","base",":","vqa","model","initialized","with","pre-trained","BLIP","base","model","on","115M","image-text","pairs","after","CapFilt",";","not","fine-tuned",".","-","vqav2",":","fine-tuned","BLIP","base","model","on","VQA","v2.0","dataset",".","Usage",":",">",">",">","from","lavis.models","import","load_model",">",">",">","model","=","load_model","(","``","blip_vqa","''",",","``","vqav2","''",")",">",">",">","model","=","load_model","(","``","blip_vqa","''",",","``","okvqa","''",")",">",">",">","model","=","load_model","(","``","blip_vqa","''",",","``","aokvqa","''",")"]
code: def from_config(cls, cfg=None):
      image_encoder = VisionTransformerEncoder.from_config(cfg)
  
      # text encoder + multimodal encoder
      text_encoder = XBertEncoder.from_config(cfg)
      text_decoder = XBertLMHeadDecoder.from_config(cfg)
  
      max_txt_len = cfg.get("max_txt_len", 35)
  
      model = cls(
          image_encoder=image_encoder,
          text_encoder=text_encoder,
          text_decoder=text_decoder,
          max_txt_len=max_txt_len,
      )
  
      model.load_checkpoint_from_config(cfg)
  
      return model
  
file_path: lavis/lavis/models/blip_models/blip_vqa.py
imports: import torch
  import torch.nn.functional
  from lavis.common.registry import registry
  from lavis.models.base_model import tile
  from lavis.models.blip_models.blip import BlipBase
  from lavis.models.blip_models.blip_outputs import BlipOutput, BlipIntermediateOutput
  from lavis.models.med import XBertEncoder, XBertLMHeadDecoder
  from lavis.models.vit import VisionTransformerEncoder
label_desc: Use image node_id 8 for calling the BlipVQA obj's underlying member method code with example usage: obj.from_config(cls, cfg) and returns: model