Download src/axolotl/utils/gradient_checkpointing/__init__.py from Alignment-Lab-AI/axolotl2: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/datasets/Alignment-Lab-AI/axolotl2/resolve/main/src/axolotl/utils/gradient_checkpointing/__init__.py
- Command line
-
hf download hf://datasets/Alignment-Lab-AI/axolotl2/src/axolotl/utils/gradient_checkpointing/__init__.py
-
curl -L -o __init__.py https://huggingface.co/datasets/Alignment-Lab-AI/axolotl2/resolve/main/src/axolotl/utils/gradient_checkpointing/__init__.py
375 Bytes
| """custom checkpointing utils""" | |
| from axolotl.utils.gradient_checkpointing.unsloth import ( | |
| Unsloth_Offloaded_Gradient_Checkpointer, | |
| ) | |
| def hf_grad_checkpoint_unsloth_wrapper( | |
| decoder_layer, *args, use_reentrant=None | |
| ): # pylint: disable=unused-argument | |
| return Unsloth_Offloaded_Gradient_Checkpointer.apply( | |
| decoder_layer.__self__, | |
| *args, | |
| ) | |