diff --git a/tutorials/multimodal/NeVA Mixtral Tutorial.ipynb b/tutorials/multimodal/NeVA Mixtral Tutorial.ipynb index 280d3e72b26e..7b33e7f1bfd2 100644 --- a/tutorials/multimodal/NeVA Mixtral Tutorial.ipynb +++ b/tutorials/multimodal/NeVA Mixtral Tutorial.ipynb @@ -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", @@ -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", @@ -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", @@ -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:" ]