Instructions to use PriyaMishra/temp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use PriyaMishra/temp with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Download project/training_optimizations.py from PriyaMishra/temp: direct link, hf CLI and curl.
- Browser
- Download file 448 Bytes
-
https://huggingface.co/PriyaMishra/temp/resolve/main/project/training_optimizations.py
- Command line
-
hf download hf://PriyaMishra/temp/project/training_optimizations.py
-
curl -L -o training_optimizations.py https://huggingface.co/PriyaMishra/temp/resolve/main/project/training_optimizations.py
448 Bytes
| """Reduce training padding while retaining sequential validation batches.""" | |
| from torch.utils.data import SequentialSampler | |
| from trl import SFTTrainer | |
| class OptimizedSFTTrainer(SFTTrainer): | |
| def _get_eval_sampler(self, eval_dataset): | |
| # Training length grouping should not change validation's batch ordering. | |
| # Accelerate shards this sequential loader and gathers the full split. | |
| return SequentialSampler(eval_dataset) | |