| 1096 | } |
| 1097 | |
| 1098 | void ToolCallConstrainer::reset() { |
| 1099 | generated_text_.clear(); |
| 1100 | current_bias_.clear(); |
| 1101 | brace_depth_ = 0; |
| 1102 | reset_needle_constraints(); |
| 1103 | |
| 1104 | if (model_type_ == Config::ModelType::LFM2) { |
| 1105 | state_ = State::LFM_START; |
| 1106 | } else if (is_gemma_family()) { |
| 1107 | state_ = State::GEMMA_START; |
| 1108 | } else if (is_needle()) { |
| 1109 | state_ = State::NEEDLE_START; |
| 1110 | } else { |
| 1111 | state_ = State::QWEN_START; |
| 1112 | } |
| 1113 | |
| 1114 | if (active_) { |
| 1115 | compute_bias(); |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | |
| 1120 | void Model::set_tool_constraints(const std::vector<ToolConstraintSpec>& tools) { |
no test coverage detected