Update basic example

This commit is contained in:
Andrei Betlen 2023-03-23 14:57:31 -04:00
parent dba6df282d
commit 3d6eb32c76

View file

@ -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))