(project_root, lib_path)
| 135 | |
| 136 | |
| 137 | def _ensure_chat_binary(project_root, lib_path): |
| 138 | tests_dir = project_root / "tests" |
| 139 | build_dir = tests_dir / "build" |
| 140 | chat_binary = build_dir / "chat" |
| 141 | chat_cpp = tests_dir / "chat.cpp" |
| 142 | |
| 143 | if not _is_stale_binary(chat_binary, [lib_path, chat_cpp]): |
| 144 | return chat_binary |
| 145 | |
| 146 | print_color(YELLOW, "Refreshing chat binary for current Cactus library...") |
| 147 | build_args = argparse.Namespace( |
| 148 | apple=False, |
| 149 | android=False, |
| 150 | flutter=False, |
| 151 | python=False, |
| 152 | ) |
| 153 | result = cmd_build(build_args) |
| 154 | if result != 0 or not chat_binary.exists(): |
| 155 | raise RuntimeError("Failed to rebuild chat binary") |
| 156 | |
| 157 | return chat_binary |
| 158 | |
| 159 | |
| 160 | def ensure_vad_weights(model_id, weights_dir, precision='INT8'): |
no test coverage detected