"""The same test, with a reader four and a half times the size.

    python bigger_reader.py

It runs the page's own answer.py with one thing changed: MODEL is
ibm-granite/granite-4.0-1b, which has 1,632 million numbers where the page's
reader has 352 million. The search, the handbook, the instruction, the test
questions and the marking are the same. The first run downloads the model,
3.3 GB, and it holds about 7 GB of memory while it runs.
"""
import os
import sys
from pathlib import Path

from huggingface_hub import snapshot_download

PAGE_FILES = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(PAGE_FILES))
import answer  # noqa: E402  (the page's own file)

BIGGER = "ibm-granite/granite-4.0-1b"


def main():
    files = [file for file in Path(snapshot_download(BIGGER)).rglob("*") if file.is_file()]
    size = sum(file.stat().st_size for file in files) / 1e9
    print(f"python answer.py found, with MODEL = {BIGGER!r}")
    print(f"that model, as downloaded: {size:.1f} GB in {len(files)} files")
    print()
    answer.MODEL = BIGGER
    os.chdir(PAGE_FILES)                # answer.py reads the handbook from where it runs
    sys.argv = ["answer.py", "found"]
    answer.main()


if __name__ == "__main__":
    main()
