Skip to content

Remove duplicate BOS token from LlamaCppInterface prompt formatting - #2

Open
tobybaratta wants to merge 1 commit into
linlab:mainfrom
tobybaratta:main
Open

Remove duplicate BOS token from LlamaCppInterface prompt formatting#2
tobybaratta wants to merge 1 commit into
linlab:mainfrom
tobybaratta:main

Conversation

@tobybaratta

Copy link
Copy Markdown

Description:
llama-cpp-python automatically adds the BOS token for GGUF models that specify it in model metadata. LlamaCppInterface currently manually prepends <|begin_of_text|>, causing llama-cpp-python to emit a duplicate-BOS warning:

Log:

Loaded 30 participant responses.
Starting theme extraction for 30 documents...
Step 1: Extracting themes from documents...
Processing document 1/30...
E:\compassion-themecloud\.venv\Lib\site-packages\llama_cpp\llama.py:1314: RuntimeWarning: Detected duplicate leading "<|begin_of_text|>" in prompt, this will likely reduce response quality, consider removing it...
  warnings.warn(

Ran using Meta-Llama-3.1-8B-Instruct GGUF + llama-cpp-python 0.3.35. On Windows. :/

(Sorry for PR from default fork, was a wee bit too hasty.)

thank you for making such an awesome tool!!

error message I got:
```
Loaded 30 participant responses.
Starting theme extraction for 30 documents...
Step 1: Extracting themes from documents...
Processing document 1/30...
E:\compassion-themecloud\.venv\Lib\site-packages\llama_cpp\llama.py:1314: RuntimeWarning: Detected duplicate leading "<|begin_of_text|>" in prompt, this will likely reduce response quality, consider removing it...
  warnings.warn(
```

ran using Meta-Llama-3.1-8B-Instruct GGUF + llama-cpp-python 0.3.35.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant