Views
No views yet
Phi3ForCausalLM that renders DOOM through
ordinary autoregressive inference. The model and the data-only fast tokenizer
load through the ordinary Transformers text-generation pipeline without
remote code.examples/e1m1_prompt.txt is the executable prompt. Run
infer.py (at the bundle root) to produce canonical emitted row ids and raw
tokenizer text. tools/pretty_text.py formats that text for reading, while
tools/txt_to_png.py independently decodes its cursor/pixel protocol into a
PNG — every cursor move and pixel in that protocol is a model-emitted token.
The protocol is specified in PROTOCOL.md in the source repo. Neither
post-processing tool participates in inference or performs geometry,
visibility, lighting, texture selection, or sorting.1from pathlib import Path
2from huggingface_hub import hf_hub_download
3from transformers import pipeline
4
5repo = "physicsrob/torchwright-doom-e1m1-80x50"
6prompt = Path(hf_hub_download(repo, "examples/e1m1_prompt.txt")).read_text()
7generate = pipeline("text-generation", model=repo, device_map="auto")
8generated_text = generate(prompt, return_full_text=False)[0]["generated_text"]infer.py when canonical integer row IDs, progress reporting, and
the exact terminal-token-preserving raw text are required.device_map="auto".
The shipped infer.py records the allocator's measured peak in
output.ids.json.FACTS.md in the source repo
(github.com/physicsrob/torchwright_doom).