Update basic example
This commit is contained in:
parent
dba6df282d
commit
3d6eb32c76
1 changed files with 8 additions and 2 deletions
|
@ -1,8 +1,14 @@
|
||||||
import json
|
import json
|
||||||
|
import argparse
|
||||||
|
|
||||||
from llama_cpp import Llama
|
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))
|
print(json.dumps(output, indent=2))
|
Loading…
Add table
Reference in a new issue