Skip to content

Instantly share code, notes, and snippets.

@BalazsHoranyi
Created May 15, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BalazsHoranyi/7ccb0daa92b58cdbda38081da1d2abdf to your computer and use it in GitHub Desktop.
Save BalazsHoranyi/7ccb0daa92b58cdbda38081da1d2abdf to your computer and use it in GitHub Desktop.
from annoy import AnnoyIndex
f = 32
t = AnnoyIndex(f)
for i in range(len(item_embeddings)):
t.add_item(i, item_embeddings[i])
t.build(10) # 10 trees
t.save('github.ann')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment