In 142565x1024, I can understand 1024 is the embedding dim. What is 142565?
If it doesn’t fit in the memory, try using lazy loading (say load just one pair at a time and compute similarity score). This will slow down the computation process (unless you parallelize it), but save RAM.