abetlen / abetlen/llama-cpp-python

System role not supported Gemma 2

Aperta
#1,580 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
10.6k
Fork
1.4k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

# Prerequisites

Please answer the following questions for yourself before submitting an issue.

- [ ] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- [ ] I carefully followed the [README.md](https://github.com/abetlen/llama-cpp-python/blob/main/README.md).
- [ X] I [searched using keywords relevant to my issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) to make sure that I am creating a new issue that is not already open (or closed).
- [X ] I reviewed the [Discussions](https://github.com/abetlen/llama-cpp-python/discussions), and have a new bug or useful enhancement to share.

# Expected Behavior

I tried Gemma2 GGUF from hugging face. It is working fine with llama.cpp CLI on my PC.
However , I got issues while runing through llama-cpp-python package as follow :

self.llama = Llama(model_path=model_path, n_gpu_layers=n_gpu_layers, n_ctx=n_ctx, echo=echo, n_batch=n_batch,flash_attn=True)

messages = [
{
"role": "system",
"content": "You are a helpful assistant who perfectly reply to user request on the topic of Mistrious Dragon"
},
{
"role": "user",
"content": "Write a beautiful stroy for kids"
}
]

output = self.llama.create_chat_completion(messages,
temperature=temperature,
max_tokens=max_tokens,
top_p=1,
frequency_penalty=1.5,
presence_penalty=1.5)

# Current Behavior

I got the following error:
......................python3.11/site-packages/llama_cpp/llama_chat_format.py", line 213, in raise_exception
raise ValueError(message)
ValueError: System role not supported

# Environment and Context

I use python3.11 on ubuntu linux with CUDA enabled . > 24GB GPU RAM

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.