Research-Reasoner-7B-v0.3 / Scripts /Inference_llama.cpp.py
Raymond-dev-546730's picture
Update Scripts/Inference_llama.cpp.py
c81c53c verified
raw
history blame
573 Bytes
from llama_cpp import Llama
# Insert your research topic here
RESEARCH_TOPIC = """
"""
model_path = "./" # Path to the directory containing your model weight files
llm = Llama(
model_path=model_path,
n_gpu_layers=33,
n_ctx=2048,
n_threads=4
)
topic = RESEARCH_TOPIC.strip()
prompt = f"USER: Research Topic: \"{topic}\"\nLet's think step by step:\nASSISTANT:"
output = llm(
prompt,
max_tokens=2500,
temperature=0.7,
top_p=0.9,
repeat_penalty=1.1
)
result = output.get("choices", [{}])[0].get("text", "").strip()
print(result)