Spaces:
Runtime error
Runtime error
Download dpo_debug.py from limitless235/llm-pushback: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/spaces/limitless235/llm-pushback/resolve/main/dpo_debug.py
- Command line
-
hf download hf://spaces/limitless235/llm-pushback/dpo_debug.py
-
curl -L -o dpo_debug.py https://huggingface.co/spaces/limitless235/llm-pushback/resolve/main/dpo_debug.py
744 Bytes
| import json | |
| from transformers import AutoTokenizer | |
| from mlx_lm_lora.trainer.datasets import load_local_dataset | |
| from types import SimpleNamespace | |
| from pathlib import Path | |
| print("Loading tokenizer...") | |
| tokenizer = AutoTokenizer.from_pretrained("mlx-community/Ministral-3-3B-Instruct-2512-4bit") | |
| config = SimpleNamespace( | |
| train_mode="dpo", | |
| prompt_feature="prompt", | |
| system_feature="system", | |
| chosen_feature="chosen", | |
| rejected_feature="rejected", | |
| mask_prompt=False | |
| ) | |
| dpo_path = Path("data/dpo") | |
| print("Loading DPO dataset (this is where it hangs in mlx_lm_lora)...") | |
| train, valid, test = load_local_dataset(dpo_path, tokenizer, config) | |
| print(f"Loaded train={len(train)}, valid={len(valid)}") | |
| print("Sample 0:", train[0]) | |