Skip to content

Commit

Permalink
Merge branch 'main' into vllm_0.6.0_integration_test
Browse files Browse the repository at this point in the history
  • Loading branch information
oyilmaz-nvidia authored Oct 2, 2024
2 parents 700fa9a + 140f791 commit 977b3ed
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tutorials/multimodal/NeVA Mixtral Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@
" --input_name_or_path /workspace/checkpoints/mixtral-8x7b-instruct \\\n",
" --output_path /workspace/checkpoints/mixtral-8x7b-instruct.nemo\n",
"\n",
"# Unpacking the NeMo checkpoint\n",
"When working with large NeMo checkpoints, it's efficient to unpack them beforehand. This avoids repeated unpacking every time the model is loaded, saving time and resources. Once unpacked, you can use the checkpoint in the same way as before.\n",
"\n",
"! mkdir mixtral_nemo_unpacked\n",
"! tar -xvf /workspace/checkpoints/mixtral-8x7b-instruct.nemo -C mixtral_nemo_unpacked\n",
"\n",
"# Prepare tokenizer\n",
"! cd /opt && git clone https://github.com/google/sentencepiece.git && \\\n",
" cd sentencepiece && \\\n",
Expand Down Expand Up @@ -237,7 +243,7 @@
"model.tokenizer.library=sentencepiece \\\n",
"model.tokenizer.model=/workspace/checkpoints/mixtral-8x7b-instruct/tokenizer_neva.model \\\n",
"model.data.num_workers=0 \\\n",
"model.mm_cfg.llm.from_pretrained=/workspace/checkpoints/mixtral-8x7b-instruct.nemo \\\n",
"model.mm_cfg.llm.from_pretrained=/workspace/checkpoints/mixtral_nemo_unpacked \\\n",
"model.mm_cfg.llm.model_type=mistral \\\n",
"model.data.conv_template=mistral \\\n",
"model.mm_cfg.vision_encoder.from_pretrained=\"google/siglip-so400m-patch14-384\" \\\n",
Expand Down Expand Up @@ -301,7 +307,7 @@
"model.tokenizer.library=sentencepiece \\\n",
"model.tokenizer.model=/workspace/checkpoints/mixtral-8x7b-instruct/tokenizer_neva.model \\\n",
"model.data.num_workers=0 \\\n",
"model.mm_cfg.llm.from_pretrained=/workspace/checkpoints/mixtral-8x7b-instruct.nemo \\\n",
"model.mm_cfg.llm.from_pretrained=/workspace/checkpoints/mixtral_nemo_unpacked \\\n",
"model.mm_cfg.llm.freeze=False \\\n",
"model.mm_cfg.llm.model_type=mistral \\\n",
"model.data.conv_template=mistral \\\n",
Expand All @@ -325,7 +331,7 @@
"\n",
"NeVA inference via the NeMo Framework can be quickly spun up via the NeMo Launcher and a few modifications to use the default NeVA inference config file.\n",
"\n",
"Inference can be run with a similar command leveraging the provided inference script `neva_evaluation.py` within the container.\n",
"Inference can be run with a similar command leveraging the provided inference script `neva_evaluation.py` within the container. You can unpack the finetuned checkpoint as mentioned earlier in the tutorial to load the model checkpoint faster.\n",
"\n",
"An example of an inference script execution:"
]
Expand Down

0 comments on commit 977b3ed

Please sign in to comment.