Skip to content

Commit

Permalink
LLaVA_13b_4bit_caption_colab
Browse files Browse the repository at this point in the history
  • Loading branch information
camenduru authored Oct 14, 2023
1 parent ba59cb1 commit cdab75a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LLaVA_13b_4bit_caption_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"from transformers import AutoTokenizer, BitsAndBytesConfig\n",
"from llava.model import LlavaLlamaForCausalLM\n",
"import torch\n",
"\n",
"model_path = \"4bit/llava-v1.5-13b-3GB\"\n",
"kwargs = {\"device_map\": \"auto\"}\n",
"kwargs['load_in_4bit'] = True\n",
Expand Down Expand Up @@ -52,7 +53,6 @@
"from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN\n",
"from llava.mm_utils import tokenizer_image_token, get_model_name_from_path, KeywordsStoppingCriteria\n",
"from transformers import TextStreamer\n",
"import torch\n",
"\n",
"def caption_image(image_file, prompt):\n",
" if image_file.startswith('http') or image_file.startswith('https'):\n",
Expand Down
2 changes: 1 addition & 1 deletion LLaVA_13b_4bit_vanilla_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"from transformers import AutoTokenizer, BitsAndBytesConfig\n",
"from llava.model import LlavaLlamaForCausalLM\n",
"import torch\n",
"\n",
"model_path = \"4bit/llava-v1.5-13b-3GB\"\n",
"kwargs = {\"device_map\": \"auto\"}\n",
"kwargs['load_in_4bit'] = True\n",
Expand Down Expand Up @@ -50,7 +51,6 @@
"from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN\n",
"from llava.mm_utils import tokenizer_image_token, get_model_name_from_path, KeywordsStoppingCriteria\n",
"from transformers import TextStreamer\n",
"import torch\n",
"\n",
"def caption_image(image_file, prompt):\n",
" if image_file.startswith('http') or image_file.startswith('https'):\n",
Expand Down

0 comments on commit cdab75a

Please sign in to comment.