burtenshaw HF Staff commited on
Commit
02a8cd1
·
verified ·
1 Parent(s): 4ecc585

Upload train.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. train.py +6 -6
train.py CHANGED
@@ -71,11 +71,11 @@ learning_rate = 2e-4
71
  """## Load model and tokenizer"""
72
 
73
  # specify how to quantize the model
74
- quantization_config = BitsAndBytesConfig(
75
- load_in_4bit=True,
76
- bnb_4bit_quant_type="nf4",
77
- bnb_4bit_use_double_quant=True,
78
- )
79
 
80
  # Load model
81
  model = AutoModelForCausalLM.from_pretrained(
@@ -83,7 +83,7 @@ model = AutoModelForCausalLM.from_pretrained(
83
  torch_dtype=torch.bfloat16,
84
  use_cache=False, # Disable KV cache during training
85
  device_map="auto",
86
- quantization_config=quantization_config
87
  )
88
 
89
  # Load tokenizer
 
71
  """## Load model and tokenizer"""
72
 
73
  # specify how to quantize the model
74
+ # quantization_config = BitsAndBytesConfig(
75
+ # load_in_4bit=True,
76
+ # bnb_4bit_quant_type="nf4",
77
+ # bnb_4bit_use_double_quant=True,
78
+ # )
79
 
80
  # Load model
81
  model = AutoModelForCausalLM.from_pretrained(
 
83
  torch_dtype=torch.bfloat16,
84
  use_cache=False, # Disable KV cache during training
85
  device_map="auto",
86
+ # quantization_config=quantization_config
87
  )
88
 
89
  # Load tokenizer