Commit Graph

29 Commits

Author SHA1 Message Date
HanishKVC b875b02979 ChatON:Initial go at vicuna chat template in meta.json
Have looked at tokenizer_config.json, jinja file and default
hardcoded template in llama.cpp.

This is also one of the models where a Global BoS is needed.

NOTE: Have taken the liberty to also add a SYSTEM: prefix wrt
system message, even thou default vicuna doesnt seem to need, but
vicuna-orca seems to need, so that both models can be driven from
same chat template config. I am assuming the system prefix should
not create any problem even in default vicuna, however if it does
create a problem one can duplicate the existing vicuna block in
chaton_meta.json and make the system prefix empty in it.
2024-05-06 11:27:56 +05:30
HanishKVC 0f8f2a18c2 ChatON:chat template for OpenChat in meta.json initial go
The first model seen, based on templates added till now into meta
json file, that needs a Global Begin.

From tokenizer_config json file, it appears like even system role
should have a appropriate prefix, unlike what is seen in hardcoded
default chat apply template of llama.cpp and chat jinja template.
2024-05-06 11:27:56 +05:30
HanishKVC 93115a9733 ChatON: initial go at OrionStar Ai chat model template
Got from its tokenizer config json. Also same found in existing
hardcoded template in default chat apply template logic of llamacpp
2024-05-06 11:27:56 +05:30
HanishKVC 5380b1e86e ChatON:Update meta.json wrt command-r models
template info picked from tokenizer config's default entry,

Verified that same is used in the existing hardcoded chat apply
template flow.
2024-05-06 11:27:56 +05:30
HanishKVC a108000cfd ChatON:Phi3: Add template details to detailed meta.json 2024-05-06 11:27:56 +05:30
HanishKVC f728dbddd0 ChatON: Add simpcfg based config file matching chaton_meta.json
Add missing begin and end fields wrt deepseek-coder assistant in
chaton_meta.json.

Idea is to avoid json library dependency by adding a simple text
based config file support.
2024-05-06 11:27:56 +05:30
HanishKVC c4e829d492 ChatON:Mistral: Decouple \n from suffix, use wrt sys msg 2024-05-06 11:27:56 +05:30
HanishKVC 55e3d63f13 ChatON:Mistral: Update to match jinja file 2024-05-06 11:27:56 +05:30
HanishKVC ad5e5216ce ChatON:Mistral: Add detailed meta json entries 2024-05-06 11:27:56 +05:30
HanishKVC 368fbf17a1 ChatON:ChatML: Update wrt detailed meta json 2024-05-06 11:27:56 +05:30
HanishKVC a64dcd7796 ChatON:Zephyr: Update wrt detailed meta json, also update eos
Pick eos from zephyr's tokenizer_config, which is different from
what was hardcoded in the existing llama_chat_apply_template.
2024-05-06 11:27:56 +05:30
HanishKVC 18cd12524f ChatON:Monarch:Update wrt detailed meta json 2024-05-06 11:27:56 +05:30
HanishKVC 006a398ebf ChatON:DeepSeekCoder: Update tmplid and wrt detailed meta json 2024-05-06 11:27:56 +05:30
HanishKVC 1b2e921186 ChatON:DeepSeek: Update support wrt detailed meta json 2024-05-06 11:27:56 +05:30
HanishKVC 403a6c4323 ChatON:Gemma: update for detailed meta json
Also as part of same add user role entry for system role also.
2024-05-06 11:27:56 +05:30
HanishKVC b9e31304a5 ChatON: Update to new detailed format wrt llama2 and llama3
Wrt llama2
* add bos wrt llama2 system and user begins, but not assistant
* split system suffix into suffix and end, and add systemuser-system
  flags so that end can be avoided wrt system+user message combo
* add eos wrt assistant end
* With these potentially this should work with main and server flows

Wrt llama3
* add empty begin, end fields and systemuser-system flags
* This should potentially work with main and server flows
2024-05-06 11:27:56 +05:30
HanishKVC 6b23f15ffe ChatON:ChatOnMetaJSon: Add suffix wrt assistant messages 2024-05-06 11:27:56 +05:30
HanishKVC f1f39c5256 ChatON:Add Monarch model template, which uses Begin + Prefix
Inturn Begin/BoS is added only for non 1st user messages in a
system+user prompts chain.
2024-05-06 11:27:56 +05:30
HanishKVC 0f713d4c4f ChatOn: meta json update wrt the new begin related fields 2024-05-06 11:27:56 +05:30
HanishKVC 84367b9fd1 ChatON: Add template for DeepSeek
Was looking at the tokenized vector, and noticed that the EOS
mentioned by existing chat_apply_template of llama.cpp, is different
from what I noticed in tokenizer_config.json of deepseek llm, so
I have added two entries

* "deepseek-alt" which matches llama.cpp's chat_apply_template and
* "deepseek" which matches that in tokenizer_config.json.

This impacts the assistant suffix and reverse prompt entries.

CasOfThis: Need to look into other entries which I added previously
at a later time. However as the default logic should be picking the
EOS from model file, so I assume reverse-prompt being outofsync,
may not matter beyond a limit, potentially.
2024-05-06 11:27:56 +05:30
HanishKVC f4b54069f6 ChatON: Add template for Gemma 2024-05-06 11:27:56 +05:30
HanishKVC 2a8028fba8 ChatON: Add Zephyr template to meta-json file 2024-05-06 11:27:56 +05:30
HanishKVC 221ccd6462 ChatOn: Add SystemUser-1st-User-Has-Prefix flag support
Llama2 seems to need it, so chaton-meta-json sample file updated
to use same.
2024-05-06 11:27:56 +05:30
HanishKVC c4cf0e9075 ChatON:Cleanup: BeginEnd, Debug log
Update the note

Rename global-prefix|suffix to global-begin|end.

Rename chat-apply-template to chat-apply-template-single, cas it
handles only a single message.

Add some debug log messages to the helper functions
2024-05-06 11:27:56 +05:30
HanishKVC d87d27512e ChatOn: update sample meta json a bit
Move [inst] [/inst] wrt llama2 from global to individual role
specific parts.

Avoid an extra \n wrt prefixes of llama3
2024-05-06 11:27:55 +05:30
HanishKVC cdbe4f06ce Chaton:Sample Meta JSON cleanup 2024-05-06 11:27:55 +05:30
HanishKVC 1374a64200 Chaton:Meta: Add chatml meta data to sample meta json file 2024-05-06 11:27:55 +05:30
HanishKVC 093abc29a2 ChatOn: Update sample meta json to be a valid json 2024-05-06 11:27:55 +05:30
HanishKVC dc56be951d ChatOn:Main: Load and dump any specified chaton meta file 2024-05-06 11:27:55 +05:30