parser llama for gigachat v3 not implemented fully
This commit is contained in:
parent
34ce48d97a
commit
62fade4c26
|
|
@ -672,6 +672,7 @@ const char * common_chat_format_name(common_chat_format format) {
|
||||||
case COMMON_CHAT_FORMAT_PEG_SIMPLE: return "peg-simple";
|
case COMMON_CHAT_FORMAT_PEG_SIMPLE: return "peg-simple";
|
||||||
case COMMON_CHAT_FORMAT_PEG_NATIVE: return "peg-native";
|
case COMMON_CHAT_FORMAT_PEG_NATIVE: return "peg-native";
|
||||||
case COMMON_CHAT_FORMAT_PEG_CONSTRUCTED: return "peg-constructed";
|
case COMMON_CHAT_FORMAT_PEG_CONSTRUCTED: return "peg-constructed";
|
||||||
|
case COMMON_CHAT_FORMAT_GIGACHAT_V3: return "GigaChat V3";
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("Unknown chat format");
|
throw std::runtime_error("Unknown chat format");
|
||||||
}
|
}
|
||||||
|
|
@ -2451,6 +2452,10 @@ static common_chat_params common_chat_params_init_seed_oss(
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
common_chat_params_init_gigachat_v3
|
||||||
|
common_chat_params_parse_gigachat_v3
|
||||||
|
|
||||||
static common_chat_params common_chat_templates_apply_jinja(
|
static common_chat_params common_chat_templates_apply_jinja(
|
||||||
const struct common_chat_templates * tmpls,
|
const struct common_chat_templates * tmpls,
|
||||||
const struct common_chat_templates_inputs & inputs)
|
const struct common_chat_templates_inputs & inputs)
|
||||||
|
|
@ -2601,6 +2606,11 @@ static common_chat_params common_chat_templates_apply_jinja(
|
||||||
return common_chat_params_init_apriel_1_5(tmpl, params);
|
return common_chat_params_init_apriel_1_5(tmpl, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GigaChatV3 format detection
|
||||||
|
if (src.find("<|role_sep|>\n") != std::string::npos && src.find("<|message_sep|>\n\n") != std::string::npos) {
|
||||||
|
return common_chat_params_init_gigachat_v3(tmpl, params);
|
||||||
|
}
|
||||||
|
|
||||||
// Use generic handler when mixing tools + JSON schema.
|
// Use generic handler when mixing tools + JSON schema.
|
||||||
// TODO: support that mix in handlers below.
|
// TODO: support that mix in handlers below.
|
||||||
if ((params.tools.is_array() && params.json_schema.is_object())) {
|
if ((params.tools.is_array() && params.json_schema.is_object())) {
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ enum common_chat_format {
|
||||||
COMMON_CHAT_FORMAT_QWEN3_CODER_XML,
|
COMMON_CHAT_FORMAT_QWEN3_CODER_XML,
|
||||||
COMMON_CHAT_FORMAT_APRIEL_1_5,
|
COMMON_CHAT_FORMAT_APRIEL_1_5,
|
||||||
COMMON_CHAT_FORMAT_XIAOMI_MIMO,
|
COMMON_CHAT_FORMAT_XIAOMI_MIMO,
|
||||||
|
COMMON_CHAT_FORMAT_GIGACHAT_V3,
|
||||||
|
|
||||||
// These are intended to be parsed by the PEG parser
|
// These are intended to be parsed by the PEG parser
|
||||||
COMMON_CHAT_FORMAT_PEG_SIMPLE,
|
COMMON_CHAT_FORMAT_PEG_SIMPLE,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue