Loading...

/cyb/LAVIS/lavis/models/blip2_models/blip2_opt.py

  • line:16~18
1
2
from lavis.models.blip2_models.modeling_opt import OPTForCausalLM, OPTConfig
#from transformers import AutoTokenizer, OPTForCausalLM, OPTConfig

更改为:

1
2
3
from lavis.models.blip2_models.modeling_opt import OPTForCausalLM, OPTConfig
#from transformers import AutoTokenizer, OPTForCausalLM, OPTConfig
from transformers import AutoTokenizer

修改前后的区别在于,后者modeling_opt.py文件中就是从huggingface上下载的opt模型实现文件,而前者则使用huggingface的transformers库调用opt模型

/cyb/LAVIS/lavis/datasets/datasets/image_text_pair_datasets.py

  • line41,42 更改
1
2
#image_path = os.path.join(self.vis_root, ann["image"])
image_path = os.path.join(self.vis_root, os.path.basename(ann["image"]))

/cyb/LAVIS/STA/model.py

  • line 595
1
2
#input = input.to(device=device).type(dtype)
input = input.to(device=device)
  • line121,122