llama.cpp/examples/basic.py

8 lines
221 B
Python
Raw Normal View History

2023-03-23 09:33:06 +00:00
import json
from llama_cpp import Llama
llm = Llama(model_path="models/...")
output = llm("Q: Name the planets in the solar system? A: ", max_tokens=32, stop=["Q:", "\n"], echo=True)
print(json.dumps(output, indent=2))