Views
No views yet
1from llama_cpp import Llama
2
3llm = Llama(
4 model_path="./models/7B/Llama-3.1-Tulu-3-8B.gguf",
5 verbose=False,
6 # n_gpu_layers=-1, # Uncomment to use GPU acceleration
7 # n_ctx=2048, # Uncomment to increase the context window
8)
9
10output = llm.create_chat_completion(
11 messages = [
12 {"role": "system", "content": "You're an AI assistant who help in answering user question"},
13 {
14 "role": "user",
15 "content": "Write an python code to find prime number"
16 }
17 ]
18)
19
20print(output["choices"][0]['message']['content'])