MCPcopy Create free account
hub / github.com/cactus-compute/cactus / get_default_stop_sequence

Method get_default_stop_sequence

cactus/engine/engine_tokenizer.cpp:261–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261std::string Tokenizer::get_default_stop_sequence() const {
262 switch (model_type_) {
263 case ModelType::GEMMA:
264 return "<end_of_turn>";
265 case ModelType::GEMMA4:
266 return "<turn|>";
267 case ModelType::QWEN:
268 case ModelType::QWEN3P5:
269 case ModelType::LFM2:
270 return "<|im_end|>";
271 case ModelType::NEEDLE:
272 return "";
273 default:
274 return "<|im_end|>";
275 }
276}
277
278std::vector<uint32_t> Tokenizer::apply_chat_template(const std::vector<ChatMessage>& messages, bool add_generation_prompt) const {
279 std::string formatted_prompt = format_chat_prompt(messages, add_generation_prompt);

Callers 1

build_stop_sequencesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected