Upload train.py with huggingface_hub
Browse files
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 |
-
|
76 |
-
|
77 |
-
|
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
|