Upload train_qwen_sovereign.py with huggingface_hub
Browse files16 unmodified lines171819202122231 unmodified line25262728293011 unmodified lines424344454647487 unmodified lines5657585960616216 unmodified linesper_device_train_batch_size=1,gradient_accumulation_steps=4,learning_rate=2e-5,logging_steps=10,save_strategy="steps",save_steps=100,report_to="none",1 unmodified linebf16=torch.cuda.is_bf16_supported(),fp16=not torch.cuda.is_bf16_supported(),max_seq_length=1024,)def get_peft_config():11 unmodified lines"""Executes the training job."""print(f"📦 Starting training for {model_id}...")# Configure 4-bit loading for memory efficiency on A10G/T4bnb_config = BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_compute_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16,7 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id,quantization_config=bnb_config if "32B" in model_id else None,device_map="auto",trust_remote_code=True)16 unmodified lines171819202122231 unmodified line2526272829303111 unmodified lines434445464748497 unmodified lines5758596061626316 unmodified linesper_device_train_batch_size=1,gradient_accumulation_steps=4,learning_rate=2e-5,logging_steps=1,save_strategy="steps",save_steps=100,report_to="none",1 unmodified linebf16=torch.cuda.is_bf16_supported(),fp16=not torch.cuda.is_bf16_supported(),max_seq_length=1024,gradient_checkpointing=True,)def get_peft_config():11 unmodified lines"""Executes the training job."""print(f"📦 Starting training for {model_id}...")# Configure 4-bit loading for all models to ensure stabilitybnb_config = BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_compute_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16,7 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id,quantization_config=bnb_config,device_map="auto",trust_remote_code=True)
train_qwen_sovereign.py+4-3