Views
No views yet
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu1241from llama_cpp import Llama
2
3llm = Llama.from_pretrained(
4 repo_id="Lumia101/EXAONE-4.0.1-32B-GGUF-Q4_K_M",
5 filename="EXAONE-4.0.1-Q4_K_M-ctemplate-removed.gguf", # Because there is an issue with the Chat Template in the original model, you must use the version with the tool usage section removed.
6 n_gpu_layers=-1,
7 n_ctx=8192, # If you have enough GPU memory, increase this value.
8 verbose=False
9)
10
11prompt = "Tell me the reason why I need GPU to run a language model." # If you would like to ask this model another question, please edit it here.
12
13output_stream = llm.create_chat_completion(
14 messages = [
15 {
16 "role": "user",
17 "content": prompt
18 }
19 ],
20 temperature=0.6,
21 top_p=0.95,
22 presence_penalty=1.5,
23 stream=True
24)
25
26for chunk in output_stream:
27 content = chunk.get('choices', [{}])[0].get('delta', {}).get('content', '')
28
29 if content:
30 print(content, end='', flush=True)
31
32print()