Description: Currently, the code generates image embeddings on the GPU using the CLIP model but doesn't ensure that the embeddings are moved to the CPU before passing them to the FAISS index. FAISS (when using faiss-cpu) expects embeddings to be on the CPU, and failing to move them can lead to device mismatch errors.
Outcome: Updated code to ensure that the embeddings generated on the GPU are moved to the CPU using .cpu() before they are passed to the FAISS index during search operation.
Description: Currently, the code generates image embeddings on the GPU using the CLIP model but doesn't ensure that the embeddings are moved to the CPU before passing them to the FAISS index. FAISS (when using faiss-cpu) expects embeddings to be on the CPU, and failing to move them can lead to device mismatch errors.
Outcome: Updated code to ensure that the embeddings generated on the GPU are moved to the CPU using .cpu() before they are passed to the FAISS index during search operation.