Skip to content

Commit

Permalink
update(llama.cpp): with Llama v3.1 model support
Browse files Browse the repository at this point in the history
  • Loading branch information
grencez committed Jul 25, 2024
1 parent 54030b1 commit 2436fa2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dep/cmake_fetchcontent/llama_cpp.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FetchContent_Declare(
LlamaCpp
GIT_REPOSITORY "https://github.com/ggerganov/llama.cpp.git"
GIT_TAG "50e05353e88d50b644688caa91f5955e8bdb9eb9"
GIT_REPOSITORY "https://github.com/jmorganca/llama.cpp.git"
GIT_TAG "0d3ce0904591ed3ad24e744ca4d7cae9af7853f8"
)

set(GGML_OPENMP FALSE CACHE BOOL "OpenMP off for compatibility.")
Expand Down
1 change: 0 additions & 1 deletion example/prompt/assistant_gemma/setting.sxpb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)

(x_priming "priming.txt")
(x_rolling "rolling.txt")
(o_rolling "../../../bld/example/prompt/assistant_gemma.txt")

; No starting space.
Expand Down
4 changes: 4 additions & 0 deletions example/prompt/assistant_llama/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Gemma Assistant

This example should be run with Gemma-style models that are tuned to behave like an instruction-following assistant chatbot.
Most importantly, the model must have special `<start_of_turn>` and `<end_of_turn>` tokens.
8 changes: 8 additions & 0 deletions example/prompt/assistant_llama/priming.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<|start_header_id|>system<|end_header_id|>

Cutting Knowledge Date: December 2023

You are a helpful assistant<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Hello!<|eot_id|>
32 changes: 32 additions & 0 deletions example/prompt/assistant_llama/setting.sxpb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(chat_prefixes (())
(m
(prefix "<|start_header_id|>user<|end_header_id|>\n\n")
(suffix "<|eot_id|>\n")
(m
(prefix "<|start_header_id|>assistant<|end_header_id|>\n\n")
(suffix "<|eot_id|>\n")
)
)
(substitution
(special_tokens (())
(() (name "<start_of_turn>"))
(() (name "<|start_header_id|>"))
(() (name "<|end_header_id|>"))
(() (name "<|eot_id|>"))
)
)

(x_priming "priming.txt")
(o_rolling "../../../bld/example/prompt/assistant_llama.txt")

; No starting space.
(startspace_on +false)
; No token penalization.
(repeat_window 0)

; 10 reasonably-long sentences at a time.
(sentence_limit 10)
(sentence_token_limit 100)

; Limit context to avoid blowing up RAM on large context models.
(model_token_limit 8000)
1 change: 0 additions & 1 deletion example/prompt/assistant_mistral/setting.sxpb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)

(x_priming "priming.txt")
(x_rolling "rolling.txt")
(o_rolling "../../../bld/example/prompt/assistant_mistral.txt")

; No starting space.
Expand Down

0 comments on commit 2436fa2

Please sign in to comment.