diff --git a/py/vqa_prompt.py b/py/vqa_prompt.py index 8c497ee..576e7da 100644 --- a/py/vqa_prompt.py +++ b/py/vqa_prompt.py @@ -56,6 +56,10 @@ class LS_LoadVQAModel: model_path = os.path.join(vqa_model_path, model) from transformers import BlipProcessor,BlipForQuestionAnswering + # if there is no local files, use repo id to auto-download the dependencies. + if not os.path.exists(model_path): + model_path = vqa_model_repos[model] + vqa_processor = BlipProcessor.from_pretrained(model_path) if precision == 'fp16': vqa_model = BlipForQuestionAnswering.from_pretrained(model_path, torch_dtype=torch.float16).to(device)