File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -785,11 +785,10 @@ def _get_state_dict_patched(model, unwrap=False):
785785 elif getattr (model .module .config , "_fp8_scales" , None ):
786786 # FP8 model (e.g. Ministral): re-quantize state dict before saving
787787 if accelerator .is_main_process :
788+ # First Party
788789 from instructlab .training .vlm_utils import requantize_fp8_state_dict
789790
790- log_rank_0 (
791- "Re-quantizing FP8 parameters for checkpoint compatibility"
792- )
791+ log_rank_0 ("Re-quantizing FP8 parameters for checkpoint compatibility" )
793792 model_state = model .module .state_dict ()
794793 model_state = requantize_fp8_state_dict (
795794 model_state , model .module .config ._fp8_scales
Original file line number Diff line number Diff line change 22import logging
33
44# Third Party
5- import torch
65from torch import nn
76from transformers import AutoConfig , AutoModelForImageTextToText , PreTrainedModel
87from transformers .models .auto import (
98 MODEL_FOR_CAUSAL_LM_MAPPING ,
109 MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING ,
1110)
11+ import torch
1212
1313logger = logging .getLogger ("instructlab.training" )
1414
You can’t perform that action at this time.
0 commit comments