Commit graph

4689 commits

Author SHA1 Message Date
Olivier Chafik
b2d17287aa update readme section about common model tool call formats
./build/bin/test-chat ../minja/build/tests/*.jinja 2>/dev/null
2025-02-04 14:27:38 +00:00
Olivier Chafik
39c1d8163b return thoughts in reasoning_content field 2025-02-04 11:37:09 +00:00
ochafik
d1b66910c5 r1: revert making <|tool▁calls▁begin|> optional as somehow sampling triggers us on "<|tool▁call▁begin|><", which is already invalid per the grammar 2025-02-04 10:38:03 +00:00
ochafik
0db9881285 Fix r1 grammar since we made <|tool▁calls▁begin|> optional (triggering on just <|tool▁call▁begin|> for 7B's sake) 2025-02-04 10:30:10 +00:00
ochafik
b5b117fa1c Merge branch 'sync-minja-4' into r1-toolcall 2025-02-04 09:45:27 +00:00
ochafik
21f207156f Update chat.cpp 2025-02-04 05:16:23 +00:00
ochafik
438ce0b8a1 fix test-chat 2025-02-04 04:51:36 +00:00
ochafik
1f5ec59809 ensure deepseek r1 thoughts parsed even w/o tool calls 2025-02-04 04:48:08 +00:00
ochafik
b6e14a4101 fix mistral expectation 2025-02-04 04:26:49 +00:00
ochafik
d44eb95c67 tool-call: ensure we don't return content when there are tool calls / warn 2025-02-04 04:18:49 +00:00
ochafik
812544ab8b server: check that content is null when we get tool_calls 2025-02-04 04:14:15 +00:00
ochafik
d43e4f6c22 Merge branch 'sync-minja-4' into r1-toolcall 2025-02-04 04:05:02 +00:00
ochafik
f12e3507f7 Update chat.cpp 2025-02-04 04:02:18 +00:00
ochafik
56a14ddc83 fix mistral chat test: need empty tokens 2025-02-04 04:01:35 +00:00
ochafik
b1527292b6 Update test-chat.cpp 2025-02-04 03:56:03 +00:00
ochafik
09caa63451 sync: minja
182de30cda
2025-02-04 03:52:59 +00:00
ochafik
86994db697 fix spaces 2025-02-04 03:47:52 +00:00
ochafik
78b47bb0e9 fix test_calc_result 2025-02-04 03:46:26 +00:00
ochafik
326e7002b3 update test_calc_result 2025-02-04 03:13:13 +00:00
ochafik
f0154a6479 Fix / test models/templates/llama-cpp-deepseek-r1.jinja 2025-02-04 03:09:15 +00:00
ochafik
a682d1216d fix / test parsing of r1 parser 2025-02-04 02:23:31 +00:00
ochafik
9a6847c857 move trigger_words init inside non-llguidance branch 2025-02-04 01:13:01 +00:00
ochafik
18a11f43f0 tool-call: r1: fix grammar 2025-02-04 01:12:44 +00:00
ochafik
e84ee88f50 r1: fix inadvertent newline in grammar before <|tool▁call▁end|> 2025-02-04 00:36:38 +00:00
Olivier Chafik
ce28224de8 tool-call: r1: add one more trigger approx "<|tool calls begin|>" 2025-02-04 00:28:40 +00:00
Olivier Chafik
bff549deb6 simplify hack to fix original template's backfill from minja 2025-02-04 00:14:48 +00:00
Olivier Chafik
bbd45bf6a2 sync: minja 2025-02-04 00:14:15 +00:00
Olivier Chafik
30ea3591c9 update to minja's new api 2025-02-03 23:53:27 +00:00
Olivier Chafik
11c1f0c7d4 actually we want eos_token in the template to infer tool call examples, explicitly skipped in new template options 2025-02-03 23:52:28 +00:00
Olivier Chafik
bc6d910f6d Merge branch 'master' into r1-toolcall 2025-02-03 23:51:31 +00:00
Olivier Chafik
cde3833239
tool-call: allow --chat-template chatml w/ --jinja, default to chatml upon parsing issue, avoid double bos (#11616)
* tool-call: allow `--jinja --chat-template chatml`

* fix double bos issue (drop bos/eos tokens from jinja template)

* add missing try catch around jinja parsing to default to chatml

* Simplify default chatml logic
2025-02-03 23:49:27 +00:00
Olivier Chafik
108da907f0 sync: minja https://github.com/google/minja/pull/46 2025-02-03 23:31:49 +00:00
Xuan-Son Nguyen
b3451785ac
server : (webui) revert hacky solution from #11626 (#11634) 2025-02-04 00:10:52 +01:00
Woof Dog
1d1e6a90bc
server : (webui) allow typing and submitting during llm response (#11626) 2025-02-03 23:16:27 +01:00
Olivier Chafik
1c302e18ba simpler hacky fixes for original broken template (+ fix minja example syntax polyfill) 2025-02-03 20:34:44 +00:00
Olivier Chafik
c6214ee9d6 rm unneeded vocab 2025-02-03 19:59:50 +00:00
Olivier Chafik
7dc271fb37 tool-calls: add deepseek r1 template + accommodate broken official template slightly better 2025-02-03 19:59:33 +00:00
Olivier Chafik
0be7f652e9 Merge branch 'jinja-chatml' into r1-toolcall 2025-02-03 19:35:54 +00:00
Olivier Chafik
d73448de1c Simplify default chatml logic 2025-02-03 19:22:53 +00:00
Olivier Chafik
569610ee77 tool-calls: accommodate variety of wrong tool call opening tags both Qwen 32B and 7B distills like to spit out 2025-02-03 18:57:55 +00:00
Olivier Chafik
c397bd1f5f tweak delta logic 2025-02-03 17:57:38 +00:00
Olivier Chafik
df3474e2c2 tool-calls: r1: add missing <|tool▁calls▁end|> to grammar! 2025-02-03 17:33:14 +00:00
Olivier Chafik
08271b5505 Merge branch 'jinja-chatml' into r1-toolcall 2025-02-03 17:32:38 +00:00
Olivier Chafik
b2dd490926 add missing try catch around jinja parsing to default to chatml 2025-02-03 17:32:12 +00:00
Olivier Chafik
4cb0e1d873 Merge branch 'jinja-chatml' into r1-toolcall 2025-02-03 17:15:14 +00:00
Olivier Chafik
2b3c4829a3 fix build / rm diff 2025-02-03 16:34:43 +00:00
Daniel Bevenius
5598f475be
server : remove CPPHTTPLIB_NO_EXCEPTIONS define (#11622)
This commit removes the CPPHTTPLIB_NO_EXCEPTIONS define from the server
code.

The motivation for this is that when using a debug build the server
would crash when an exception was throws and terminate the server
process, as it was unhandled. When CPPHTTPLIB_NO_EXCEPTIONS is set
cpp_httplib will not call the exception handler, which would normally
return a 500 error to the client. This caused tests to fail when using
a debug build.

Fixes: https://github.com/ggerganov/llama.cpp/issues/11613
2025-02-03 16:45:38 +01:00
Olivier Chafik
aa98e59038 fix bad merge 2025-02-03 14:01:49 +00:00
Olivier Chafik
5d18d76b69 fix double bos issue (drop bos/eos tokens from jinja template) 2025-02-03 13:59:16 +00:00
Olivier Chafik
cf83623a47 fix typo 2025-02-03 13:58:46 +00:00