| 119 | } |
| 120 | |
| 121 | void save(const std::string& path) const { |
| 122 | if (!built_) { |
| 123 | throw std::runtime_error("HnswIndex must be built or loaded before save"); |
| 124 | } |
| 125 | index_->save(path.c_str()); |
| 126 | } |
| 127 | |
| 128 | static HnswIndex load(const std::string& path) { |
| 129 | HnswIndex wrapper; |