/cyb/LAVIS/lavis/models/blip2_models/blip2_opt.py
1 2
| from lavis.models.blip2_models.modeling_opt import OPTForCausalLM, OPTConfig
|
更改为:
1 2 3
| from lavis.models.blip2_models.modeling_opt import OPTForCausalLM, OPTConfig
from transformers import AutoTokenizer
|
修改前后的区别在于,后者modeling_opt.py
文件中就是从huggingface上下载的opt模型实现文件,而前者则使用huggingface的transformers库调用opt模型
/cyb/LAVIS/lavis/datasets/datasets/image_text_pair_datasets.py
1 2
| image_path = os.path.join(self.vis_root, os.path.basename(ann["image"]))
|
/cyb/LAVIS/STA/model.py
1 2
| input = input.to(device=device)
|