Upload code/train_sft.py with huggingface_hub
Browse files507 unmodified lines508509510511512513514515516517507 unmodified lines# Optional torch.compile for maximum speedif args.compile and hasattr(torch, "compile"):print("⚡ Compiling model with torch.compile(mode='reduce-overhead')...")try:model = torch.compile(model, mode="reduce-overhead")print("✅ Model compiled successfully!")except Exception as e:print(f"⚠️ Could not compile model: {e}")507 unmodified lines508509510511512513514515516517507 unmodified lines# Optional torch.compile for maximum speedif args.compile and hasattr(torch, "compile"):print("⚡ Compiling model with torch.compile(dynamic=True)...")try:model = torch.compile(model, dynamic=True)print("✅ Model compiled successfully with dynamic shape support!")except Exception as e:print(f"⚠️ Could not compile model: {e}")
code/train_sft.py+3-3