You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>To save and reload Annoy indices from disk, we need to register a loading function into <b>knncolle</b>'s <code>load_prebuilt_registry()</code>. This is a little complicated as we must decide on which combinations of types and distances we want to deal with. In the example below, we only consider the obvious distance metrics and the defaults for the internal Annoy types, though more combinations could also be supported at the cost of larger binaries and longer compile times.</p>
</div><!-- fragment --><p>Then we can save and reload the <code>Prebuilt</code> Annoy indices. Note the caveats on <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#add21dc74e08a6ad495c6e241fa3d5968">knncolle::Prebuilt::save()</a></code> - specifically, the files are not guaranteed to be portable between machines or even different versions of <b><aclass="el" href="namespaceknncolle__annoy.html" title="Approximate nearest neighbor search with Annoy.">knncolle_annoy</a></b>.</p>
195
+
</div><!-- fragment --><p>Then we can save and reload the <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html">knncolle::Prebuilt</a></code> Annoy indices. Note the caveats on <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#add21dc74e08a6ad495c6e241fa3d5968">knncolle::Prebuilt::save()</a></code> - specifically, the files are not guaranteed to be portable between machines or even different versions of <b><aclass="el" href="namespaceknncolle__annoy.html" title="Approximate nearest neighbor search with Annoy.">knncolle_annoy</a></b>.</p>
<divclass="line"><spanclass="keywordflow">throw</span> std::runtime_error(<spanclass="stringliteral">"unexpected type for the Annoy index"</span>);</div>
0 commit comments