Skip to content

Commit d5da7f0

Browse files
committed
test
1 parent c55def3 commit d5da7f0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

llama-test/test.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from langchain.llms import LlamaCpp
2+
from torch import cuda
3+
4+
print(cuda.current_device())
5+
6+
llama-2-70b-chat.ggmlv3.q3_K_L.bin
7+
# wget https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/resolve/main/llama-2-7b-chat.ggmlv3.q2_K.bin
8+
model_path = r'/home/ivanrocha/Downloads/Llama/llama-2-7b-chat.ggmlv3.q2_K.bin'
9+
10+
llm = LlamaCpp(
11+
model_path=model_path,
12+
n_gpu_layers=4,
13+
n_ctx=512,
14+
temperature=0
15+
)
16+
17+
output = llm("Q: Name the planets in the solar system? A: ", max_tokens=32, stop=["Q:", "\n"])
18+
19+
print(output)

0 commit comments

Comments
 (0)