Commit graph

3035 commits

Author SHA1 Message Date
HanishKVC
a09571318a ChatON: meta-dump returns flag inturn returned by meta-ok
test-chat-template-chaton now tries to check if meta-ok is ok wrt
the template-id being looked into.

Log template-id info also, where it was previously missed out.
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
44c05305d0 SimpCfg: Add support for get_double 2024-05-06 11:27:56 +05:30
HanishKVC
8ad2c17e5d SimpCfg: get_int64 logic 2024-05-06 11:27:56 +05:30
HanishKVC
000245b8e8 SimpCfg:Warn possible nonstring strings, some invalid floats
Warn if something not starting with double quote is being treated
as a string.

Show some examples of invalid floating point values wrt this
logics floating point determination code
2024-05-06 11:27:56 +05:30
HanishKVC
a6648b02f2 SimpCfg:Show floating point values in normal and exponential form 2024-05-06 11:27:56 +05:30
HanishKVC
4181164217 SimpCfg:Implement set_int64 and set_double
Also update the sample simpcfg file, to test for int and float
values.
2024-05-06 11:27:56 +05:30
HanishKVC
fb9a7dc7fe SimpCfg:Initial skeleton towards supporting int and floating point 2024-05-06 11:27:56 +05:30
HanishKVC
d0b3ebf32e SimpCfg: Use & wrt destination of [] operation
so that one can update the value-item's content, without needing
to explicitly update/store the value-item back into map after the
content has been updated.

This should make these setting operations/helpers more efficient.
2024-05-06 11:27:56 +05:30
HanishKVC
0a534e6897 SimpCfg: Rename test program related #define 2024-05-06 11:27:56 +05:30
HanishKVC
ca5a04d607 SimpCfg: Remove double quotes around group, key or string value 2024-05-06 11:27:56 +05:30
HanishKVC
82348e2840 SimpCfg: Put GroupMap back into Map, Iterate during get if DBUG
TODO: Have to look into C++ a bit later including these default
container types. Not sure my current flow is efficient.
2024-05-06 11:27:56 +05:30
HanishKVC
9940bd8ed7 SimpCfg: Allow default values wrt set string and set bool 2024-05-06 11:27:56 +05:30
HanishKVC
951fbc3396 SimpCfg: Change logging to LDBUG and LERRR helpers 2024-05-06 11:27:56 +05:30
HanishKVC
d514c81829 SimpCfg: Add the const which I had forgotten wrt args 2024-05-06 11:27:56 +05:30
HanishKVC
6de8a14f32 SimpCfg: Rename member functions to avoid sc_ prefix
now that logic has been converted into a class, no need for this
prefix
2024-05-06 11:27:56 +05:30
HanishKVC
1ecca5a7ec SimpCfg: Convert to a class 2024-05-06 11:27:56 +05:30
HanishKVC
28ae0c5b02 SimpCfg:Make str_trim flexible, use to trim , wrt value
Now one can pass the list/string of chars to trim at either end.
2024-05-06 11:27:56 +05:30
HanishKVC
2cbb00c340 SimpCfg: Add support for boolean fields wrt key-value 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
aea6850131 SimpCfg: Keep compiler happy, also add newline wrt alt logging def 2024-05-06 11:27:56 +05:30
HanishKVC
f4687fa5d4 SimpCfg:Parse config file and load string key-value fields 2024-05-06 11:27:56 +05:30
HanishKVC
ce75d434dc SimpCfg: Initial skeleton : get and set string and bool values 2024-05-06 11:27:56 +05:30
HanishKVC
af9a0a211b ChatON:ChatTmplApply: Avoid the stringstream 2024-05-06 11:27:56 +05:30
HanishKVC
889a45ff28 ChatON:ChatTmplApply:Update the function notes 2024-05-06 11:27:56 +05:30
HanishKVC
ff5f68826b ChatON:ChatTmplApplySingle: Avoid streamstring, update func notes 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
a724fd90bd ChatON:Tests: Add a test templates program for chaton 2024-05-06 11:27:56 +05:30
HanishKVC
32e672c5dd ChatON: Dont log final tagged message string to screen 2024-05-06 11:27:56 +05:30
HanishKVC
cad50c527e ChatON: Update the note to match current logic 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
a4b3285034 ChatON:Show Log on screen when template is applied 2024-05-06 11:27:56 +05:30
HanishKVC
d61b071b8d Chaton:Common:Add missing newline wrt cmdline arg usage 2024-05-06 11:27:56 +05:30
HanishKVC
fee887fe31 ChatON:Common:Update the cmdline argument name used
Had forgotten to update it before
2024-05-06 11:27:56 +05:30
HanishKVC
58e1ff16bc ChatON: switch to ordered_json from json library
to be in sync with the json namespace in server.
2024-05-06 11:27:56 +05:30
HanishKVC
a630564c48 ChatON:ChatTemplateApplyCAPI remaining base logic
As c doesnt have the concept of pass by reference, and inturn the
existing c api uses pointers wrt llama chat message structure, so
switching to same wrt chat_tmpl_apply logics.

Also fix a oversight in previous commit and add the remaining logic.
2024-05-06 11:27:56 +05:30
HanishKVC
308d3bf3ff ChatON:WIP:Add c api wrapper for chat_template_apply
Initial skeletons

Update existing logics to help with same. Also the inbetween helper
was having a bad signature wrt returning status and data, thats also
fixed.
2024-05-06 11:27:56 +05:30
HanishKVC
e62699f923 ChatON: Add alertAssistantAtEnd flag & logic wrt MultiMsgs Apply
While sending the current chat session along with new user query
to the model, many models expect that a tag be added at the end
to indicate that user is expecting the model to respond, this
flags allows for the same.
2024-05-06 11:27:56 +05:30
HanishKVC
ea3a0f19cc ChatON: Rather check for tmpl existance in single_ex 2024-05-06 11:27:56 +05:30
HanishKVC
01c8db70f7 ChatON+Main: Add C_API wrapper for single
Add a c api wrapper for a single message tagging scenario.

Inturn to match convention followed by existing chat_apply_template
code, make it return the size expected of the tagged message string
buffer. Update internal single logic to help with same.

Explicitly check if tmpl specified is available in the loaded json
or not and then return a error if not found.
2024-05-06 11:27:56 +05:30
HanishKVC
13857f29d6 ChatON+Main: Updates wrt detailed meta json
Fix a oversight wrt key name.

Add a alert in case if passed meta json file contains begin(BoS)
wrt assistant role, similar to check for end (EoS) wrt user role.
Bcas normally both (ie EoS wrt User and BoS wrt Assistant) shouldnt
be needed.

Update main wrt begin & prefix and suffix & end addition.
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
bf1167bfdb ChatON: Backup the current simple meta json file 2024-05-06 11:27:56 +05:30