examples icon indicating copy to clipboard operation
examples copied to clipboard

faiss_tutorial/intro.ipynb wrong file naming

Open gitgithan opened this issue 2 years ago • 0 comments

# saving data
split = 256
file_count = 0
for i in range(0, sentence_embeddings.shape[0], split):
    end = i + split
    if end > sentence_embeddings.shape[0] + 1:
        end = sentence_embeddings.shape[0] + 1
    file_count = '0' + str(file_count) if file_count < 0 else str(file_count)
    with open(f'./sim_sentences/embeddings_{file_count}.npy', 'wb') as fp:
        np.save(fp, sentence_embeddings[i:end, :])
    print(f"embeddings_{file_count}.npy | {i} -> {end}")
    file_count = int(file_count) + 1

It seems file_count < 10 is intended

gitgithan avatar Feb 17 '23 08:02 gitgithan