"""Run a downloaded Standard program on the local CPU."""
import argparse
from pathlib import Path

import programasweights as paw

parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("program", type=Path, help="Path to the downloaded .paw file")
parser.add_argument("text", help="Request for the model")
parser.add_argument("--prepare", action="store_true", help="Allow the SDK to download the matching interpreter")
args = parser.parse_args()

with paw.function(str(args.program.resolve()), offline=not args.prepare, n_gpu_layers=0) as model:
    print(model(args.text))
