Views
No views yet
1# Download llama.cpp and build
2git clone https://github.com/ggerganov/llama.cpp
3cd llama.cpp
4cmake -B build
5cmake --build build --config Release -j
6
7# Run inference
8./build/bin/llama-cli -m glm-flash-2500-Q4_KM.gguf -p "Write a Python function to merge two sorted lists" -n 256 -t 81from llama_cpp import Llama
2
3model = Llama(
4 model_path="glm-flash-2500-Q4_KM.gguf",
5 n_ctx=8192,
6 n_threads=8,
7)
8
9output = model(
10 "Write a function to merge two sorted lists:",
11 max_tokens=256,
12 stop=["
13
14"],
15 echo=True
16)
17print(output['choices'][0]['text'])./build/bin/llama-cli -m glm-flash-2500-Q4_KM.gguf -cnv -i -t 8