fix: load 4-bit model AS-IS without additional quantization
This commit is contained in:
@@ -36,15 +36,15 @@ def train(config_path):
|
||||
print(f"Loading model: {config['base_model']}")
|
||||
from transformers import BitsAndBytesConfig, AutoConfig
|
||||
|
||||
# Skip quantization - use DeepSpeed ZeRO-3 with CPU offload
|
||||
# Load 4-bit model AS-IS (don't apply additional quantization)
|
||||
print(f"Loading model: {config['base_model']}")
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
config["base_model"],
|
||||
torch_dtype=torch.bfloat16,
|
||||
device_map="cpu", # Load to CPU first
|
||||
torch_dtype=torch.float16,
|
||||
device_map="auto",
|
||||
trust_remote_code=True,
|
||||
)
|
||||
print("Model loaded to CPU. DeepSpeed will distribute.")
|
||||
print("Model loaded (4-bit). DeepSpeed will distribute.")
|
||||
|
||||
# Prepare model for k-bit training
|
||||
from peft import prepare_model_for_kbit_training
|
||||
|
||||
Reference in New Issue
Block a user