| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = ["trl", "datasets"] | |
| # /// | |
| """Simple SFT training WITHOUT trackio - logs should flow normally.""" | |
| import sys | |
| sys.stdout.reconfigure(line_buffering=True) | |
| from datasets import load_dataset | |
| from trl import SFTTrainer, SFTConfig | |
| print("=" * 50) | |
| print("Training WITHOUT Trackio") | |
| print("=" * 50) | |
| dataset = load_dataset("trl-lib/Capybara", split="train[:1000]") | |
| print(f"Dataset loaded: {len(dataset)} samples") | |
| config = SFTConfig( | |
| output_dir="./output", | |
| max_steps=50, | |
| logging_steps=10, | |
| report_to="none", | |
| ) | |
| trainer = SFTTrainer( | |
| model="Qwen/Qwen2.5-0.5B", | |
| train_dataset=dataset, | |
| args=config, | |
| ) | |
| print("Starting training...") | |
| trainer.train() | |
| print("Training complete!") | |
| print("=" * 50) | |