Skip to content

Commit

Permalink
Add multi-modal to args
Browse files Browse the repository at this point in the history
  • Loading branch information
kcz358 committed Oct 16, 2024
1 parent 0070d0a commit 3cddae3
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 3cddae3

Please sign in to comment.