Shrijanagain commited on
Commit
0849d8e
·
verified ·
1 Parent(s): 1b930bb

Upload sft_skt.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. sft_skt.py +3 -2
sft_skt.py CHANGED
@@ -122,8 +122,9 @@ def main():
122
  kw["quantization_config"] = BitsAndBytesConfig(
123
  load_in_4bit=True, bnb_4bit_quant_type="nf4",
124
  bnb_4bit_compute_dtype=torch.bfloat16,
125
- bnb_4bit_use_double_quant=True)
126
- kw["device_map"] = "auto"
 
127
  print("[model] loading in 4-bit NF4")
128
  else:
129
  kw["dtype"] = torch.bfloat16 if not hasattr(torch, "bfloat16") or True else None
 
122
  kw["quantization_config"] = BitsAndBytesConfig(
123
  load_in_4bit=True, bnb_4bit_quant_type="nf4",
124
  bnb_4bit_compute_dtype=torch.bfloat16,
125
+ bnb_4bit_use_double_quant=True,
126
+ llm_int8_enable_fp32_cpu_offload=True) # safety valve
127
+ kw["device_map"] = {"": 0} # force GPU0, no CPU dispatch
128
  print("[model] loading in 4-bit NF4")
129
  else:
130
  kw["dtype"] = torch.bfloat16 if not hasattr(torch, "bfloat16") or True else None