Skip to content

Commit

Permalink
Merge pull request #307 from LLaVA-VL/fix_tut
Browse files Browse the repository at this point in the history
  • Loading branch information
Luodian authored Oct 16, 2024
2 parents 1a7e8b2 + 3cddae3 commit 79ef45a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/LLaVA_OneVision_Tutorials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
"model_name = \"llava_qwen\"\n",
"device = \"cuda\"\n",
"device_map = \"auto\"\n",
"tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, device_map=device_map) # Add any other thing you want to pass in llava_model_args\n",
"llava_model_args = {\n",
" \"multimodal\": True,\n",
" \"attn_implementation\": \"sdpa\",\n",
"}\n",
"tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, device_map=device_map, **llava_model_args) # Add any other thing you want to pass in llava_model_args\n",
"\n",
"model.eval()\n",
"\n",
Expand Down Expand Up @@ -308,7 +312,10 @@
"model_name = \"llava_qwen\"\n",
"device = \"cuda\"\n",
"device_map = \"auto\"\n",
"tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, device_map=device_map, attn_implementation=\"sdpa\")\n",
"llava_model_args = {\n",
" \"multimodal\": True,\n",
"}\n",
"tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, device_map=device_map, attn_implementation=\"sdpa\", **llava_model_args)\n",
"\n",
"model.eval()\n",
"\n",
Expand Down

0 comments on commit 79ef45a

Please sign in to comment.