Llama3 instruct prompt template missing BOS token
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- ai, backend-api-design
Direzione di ricerca
Il problema si trova nel template del prompt di chat di Llama3. Esamina il file llama_cpp/llama_chat_format.py e la funzione format_llama3. Confronta l'output tra le versioni 0.2.77 e 0.2.78 per vedere il token BOS mancante, '<|begin_of_text|>'. Aggiungi nuovamente il token alla costruzione del prompt. Esegui il test importando la funzione e verificando che l'output corrisponda al formato previsto dalla documentazione di Meta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
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.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
Llama3 models using the prompt template in llama-cpp-python>0.2.77 are missing the BOS token and then the model quality is degraded.
For example, the Meta doc on Llama 3 has prompt template examples here: https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/
Current Behavior
Result of an empty format_llama3({}) after from llama_cpp.llama_chat_format import format_llama3:
0.2.78:
ChatFormatterResponse(prompt='<|start_header_id|>assistant<|end_header_id|>\n\n', stop='<|eot_id|>', stopping_criteria=None, added_special=False)
0.2.77:
ChatFormatterResponse(prompt='<|begin_of_text|><|start_header_id|>assistant<|end_header_id|>\n\n', stop='<|eot_id|>', stopping_criteria=None)
Environment and Context
- Operating System, e.g. for Linux:
22.6.0 Darwin Kernel Version 22.6.0: Mon Apr 22 20:49:37 PDT 2024; root:xnu-8796.141.3.705.2~1/RELEASE_ARM64_T6000 arm64
- SDK version, e.g. for Linux:
Python 3.10.13
GNU Make 3.81
$ g++ --version
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Install versions 0.2.77 and 0.2.78 and test anything with a Llama 3 model and llm.create_chat_completion. In addition, import the templates and check the difference.
I am using https://huggingface.co/bartowski/Meta-Llama-3-8B-Instruct-GGUF/tree/main as a model for testing, particularly the Q5_K_M quantization, but this should affect all models.
- Lingua principale
- Python
- Stelle
- 10.6k
- Fork
- 1.5k
- Merge medio
- 6h 43m
- PR unite (30g)
- 2
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di abetlen/llama-cpp-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
abetlen/llama-cpp-python#2371 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
abetlen/llama-cpp-python#2352 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
abetlen/llama-cpp-python#2314 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
abetlen/llama-cpp-python#2211 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
abetlen/llama-cpp-python#2210 ·
Tutte le issue di abetlen/llama-cpp-python
Issue simili
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vllm-project/vllm-metal#822 ·
I maintainer di solito rispondono entro 1 giorno
-
vector-store
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
mem0ai/mem0#7461 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BasedHardware/omi#19047 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno