* add llamacpp server support * use gbnf loader * cleanup and warning about grammar when not using llama.cpp * added memgpt-specific grammar file * add grammar support to webui api calls * black * typo * add koboldcpp support * no more defaulting to webui, should error out instead * fix grammar * patch kobold (testing, now working) + cleanup log messages Co-Authored-By: Drake-AI <drake-ai@users.noreply.github.com>
26 lines
555 B
Python
26 lines
555 B
Python
from ...constants import LLM_MAX_TOKENS
|
|
|
|
# see https://lite.koboldai.net/koboldcpp_api#/v1/post_v1_generate
|
|
SIMPLE = {
|
|
"stop_sequence": [
|
|
"\nUSER:",
|
|
"\nASSISTANT:",
|
|
"\nFUNCTION RETURN:",
|
|
"\nUSER",
|
|
"\nASSISTANT",
|
|
"\nFUNCTION RETURN",
|
|
"\nFUNCTION",
|
|
"\nFUNC",
|
|
"<|im_start|>",
|
|
"<|im_end|>",
|
|
"<|im_sep|>",
|
|
# '\n' +
|
|
# '</s>',
|
|
# '<|',
|
|
# '\n#',
|
|
# '\n\n\n',
|
|
],
|
|
"max_context_length": LLM_MAX_TOKENS,
|
|
"max_length": 512,
|
|
}
|