from open_flamingo import create_model_and_transforms
model, image_processor, tokenizer = create_model_and_transforms(
clip_vision_encoder_path="ViT-L-14",
clip_vision_encoder_pretrained="openai",
lang_encoder_path="anas-awadalla/mpt-1b-redpajama-200b",
tokenizer_path="anas-awadalla/mpt-1b-redpajama-200b",
cross_attn_every_n_layers=1,
cache_dir="" # Defaults to ~/.cache
)
when I run this code, this issue occurs:
TypeError: Flamingo.init() got an unexpected keyword argument 'cache_dir'
it is because the version in github is later than the one in the pip package(open-flamingo). Try replacing the factory.py in the open-flamingo with the one in the github
from open_flamingo import create_model_and_transforms
model, image_processor, tokenizer = create_model_and_transforms( clip_vision_encoder_path="ViT-L-14", clip_vision_encoder_pretrained="openai", lang_encoder_path="anas-awadalla/mpt-1b-redpajama-200b", tokenizer_path="anas-awadalla/mpt-1b-redpajama-200b", cross_attn_every_n_layers=1, cache_dir="" # Defaults to ~/.cache ) when I run this code, this issue occurs: TypeError: Flamingo.init() got an unexpected keyword argument 'cache_dir'