Spaces:
Running on Zero
Running on Zero
Download src/diffusion_lm/generation_prompts.py from Ruurd/llada-8b-instruct: direct link, hf CLI and curl.
- Browser
- Download file 750 Bytes
-
https://huggingface.co/spaces/Ruurd/llada-8b-instruct/resolve/main/src/diffusion_lm/generation_prompts.py
- Command line
-
hf download hf://spaces/Ruurd/llada-8b-instruct/src/diffusion_lm/generation_prompts.py
-
curl -L -o generation_prompts.py https://huggingface.co/spaces/Ruurd/llada-8b-instruct/resolve/main/src/diffusion_lm/generation_prompts.py
750 Bytes
| """Shared ordered prompts for training and benchmark generation.""" | |
| from pathlib import Path | |
| GENERATION_PROMPTS_PATH = Path(__file__).with_name("generation_prompts.txt") | |
| def _load_generation_prompts(path: str | Path = GENERATION_PROMPTS_PATH) -> tuple[str, ...]: | |
| """Load the shared, ordered generation-validation prompt set.""" | |
| prompts = tuple( | |
| line | |
| for raw_line in Path(path).read_text().splitlines() | |
| if (line := raw_line.strip()) and not line.startswith("#") | |
| ) | |
| if not prompts: | |
| raise ValueError(f"Generation prompt file is empty: {path}") | |
| return prompts | |
| # Resolve once so every validation checkpoint in a run uses the exact same set. | |
| DEFAULT_GENERATION_PROMPTS = _load_generation_prompts() | |