examples
examples copied to clipboard
faiss_tutorial/intro.ipynb wrong file naming
# 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