Upload train_tiny.py with huggingface_hub
Browse files- train_tiny.py +8 -0
train_tiny.py
CHANGED
|
@@ -228,6 +228,14 @@ def train():
|
|
| 228 |
if "token_embed" in name or "lm_head" in name:
|
| 229 |
param.requires_grad = True
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
hf_repo = d_cfg.get("hf_repo")
|
| 232 |
is_streaming = bool(hf_repo)
|
| 233 |
|
|
|
|
| 228 |
if "token_embed" in name or "lm_head" in name:
|
| 229 |
param.requires_grad = True
|
| 230 |
|
| 231 |
+
# ββ torch.compile ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 232 |
+
if t_cfg.get("compile", False):
|
| 233 |
+
try:
|
| 234 |
+
model = torch.compile(model, dynamic=True)
|
| 235 |
+
print("[Compile] torch.compile enabled (dynamic=True)")
|
| 236 |
+
except Exception as e:
|
| 237 |
+
print(f"[Compile] Failed: {e} β continuing without compile")
|
| 238 |
+
|
| 239 |
hf_repo = d_cfg.get("hf_repo")
|
| 240 |
is_streaming = bool(hf_repo)
|
| 241 |
|