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
{{ message }}
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
MAX_VECTORS = 300 # This script takes a lot of RAM (>2GB for 200K vectors), if you want to use the full 3M embeddings then you probably need to insert the vectors into some kind of database
FLOAT_SIZE = 4 # 32bit float
vectors = dict()
with open(FILE_NAME, 'rb') as f:
c = None
# read the header
header = ""
while c != "\n":
c = f.read(1)
header += str(c)
print(header)
total_num_vectors, vector_len = (int(x) for x in header.split())
num_vectors = min(MAX_VECTORS, total_num_vectors)
print( "Number of vectors: %d/%d") % (num_vectors, total_num_vectors)