From 3d6eb32c76f0a05021ba1053692eaf5fe05b04b2 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Thu, 23 Mar 2023 14:57:31 -0400 Subject: [PATCH] Update basic example --- examples/basic.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/basic.py b/examples/basic.py index a936bbc..c676e55 100644 --- a/examples/basic.py +++ b/examples/basic.py @@ -1,8 +1,14 @@ import json +import argparse + from llama_cpp import Llama -llm = Llama(model_path="models/...") +parser = argparse.ArgumentParser() +parser.add_argument("-m", "--model", type=str, default="../models/...") +args = parser.parse_args() -output = llm("Q: Name the planets in the solar system? A: ", max_tokens=32, stop=["Q:", "\n"], echo=True) +llm = Llama(model_path=args.model) + +output = llm("Question: What are the names of the planets in the solar system? Answer: ", max_tokens=48, stop=["Q:", "\n"], echo=False) print(json.dumps(output, indent=2)) \ No newline at end of file