Skip to content

Conversation

@danbev
Copy link
Member

@danbev danbev commented Feb 13, 2025

The commit adds the following special tokens for CodeLlama infill:

  • ▁<PRE>
  • ▁<SUF>
  • ▁<MID>

The motivation for this is that currently the infill example uses CodeLlama as a suggested model. But when using this model the following error is generated:

/llama.cpp-debug/examples/infill/infill.cpp:165: GGML_ASSERT(llama_vocab_fim_pre(vocab) >= 0) failed

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No stack.
The program is not being run.
305251 Aborted                 (core dumped)
./build/bin/llama-infill -t 10 -ngl 0 -m models/codellama-13b.Q5_K_S.gguf \
  -c 4096 --temp 0.7 --repeat_penalty 1.1 -n 20 \
  --in-prefix "def helloworld():\n    print(\"hell" \
  --in-suffix "\n   print(\"goodbye world\")\n    "

The commit adds the following special tokens for CodeLlama infill:
- `▁<PRE>`
- `▁<SUF>`
- `▁<MID>`

The motivation for this is that currently the infill example uses
CodeLlama as a suggested model. But when using this model the following
error is generated:
```console
/llama.cpp-debug/examples/infill/infill.cpp:165: GGML_ASSERT(llama_vocab_fim_pre(vocab) >= 0) failed

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No stack.
The program is not being run.
305251 Aborted                 (core dumped)
./build/bin/llama-infill -t 10 -ngl 0 -m models/codellama-13b.Q5_K_S.gguf \
  -c 4096 --temp 0.7 --repeat_penalty 1.1 -n 20 \
  --in-prefix "def helloworld():\n    print(\"hell" \
  --in-suffix "\n   print(\"goodbye world\")\n    "
```
@CISC
Copy link
Collaborator

CISC commented Mar 19, 2025

It looks like this was an accidental regression in a refactoring.

You should probably also add ▁<EOT> here

|| t.first == "<EOT>"

and here
|| t.first == "<EOT>"

@CISC
Copy link
Collaborator

CISC commented Mar 31, 2025

@danbev ping

@danbev
Copy link
Member Author

danbev commented Mar 31, 2025

@CISC Thanks for the ping, I completely missed this. I'll take a look hopefully later today or tomorrow at the latest.

@danbev danbev merged commit c80a775 into ggml-org:master Mar 31, 2025
48 checks passed
@danbev danbev deleted the infill-example-fix branch August 13, 2025 09:18
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.

2 participants