import torch from transformers import AutoTokenizer, AutoModelForCausalLM from llava.model.builder import load_pretrained_model if __name__ == "__main__": vlm_model_name = "liuhaotian/llava-v1.5-7b" vlm_tokenizer, vlm_model, image_processor, context_len = load_pretrained_model( model_path=vlm_model_name, model_base=None, model_name="llava-v1.5-7b", load_bf16=True, device_map="cpu", device="cpu" )
![Chat VectorでLLaVAを日本語対応させる](https://cdn-ak-scissors.b.st-hatena.com/image/square/72905fc059d61f32f6c3a678e89b9e95ea08f382/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--BKS4XCdO--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3AChat%252520Vector%2525E3%252581%2525A7LLaVA%2525E3%252582%252592%2525E6%252597%2525A5%2525E6%25259C%2525AC%2525E8%2525AA%25259E%2525E5%2525AF%2525BE%2525E5%2525BF%25259C%2525E3%252581%252595%2525E3%252581%25259B%2525E3%252582%25258B%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3Atoshi_456%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyL2VhYTMxODJkNmQuanBlZw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)