fix: use Ornith-1.0-35B bf16 base model (PEFT compatible)

This commit is contained in:
Christian Medina
2026-07-01 07:28:21 -04:00
parent 05ace2d38f
commit 9d92531c55
2 changed files with 3 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
# LoRA Training Configuration for Llama-2-7b # LoRA Training Configuration for Llama-2-7b
# Dataset: cyron_summary_lora_dataset (20k examples) # Dataset: cyron_summary_lora_dataset (20k examples)
base_model: /data/models/Ornith-1.0-35B-NVFP4 base_model: /data/models/Ornith-1.0-35B
model_type: LlamaForCausalLM model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer tokenizer_type: LlamaTokenizer

View File

@@ -32,17 +32,15 @@ def train(config_path):
print(f"Loading model: {config['base_model']}") print(f"Loading model: {config['base_model']}")
# Load model and convert to bf16 (remove NVFP4 quantization) # Load bf16 model
print(f"Loading model: {config['base_model']}") print(f"Loading model: {config['base_model']}")
model = AutoModelForCausalLM.from_pretrained( model = AutoModelForCausalLM.from_pretrained(
config["base_model"], config["base_model"],
torch_dtype=torch.bfloat16, torch_dtype=torch.bfloat16,
device_map="cpu", # Load to CPU first device_map="cpu", # Load to CPU first
trust_remote_code=True, trust_remote_code=True,
# Override any quantization config (NVFP4 -> bf16)
_fast_init=False,
) )
print("Model loaded and converted to bf16.") print("Model loaded.")
# Add LoRA # Add LoRA
lora_config = LoraConfig( lora_config = LoraConfig(