Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NeVA Mixtral Tutorial #10669

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading