mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 10:08:42 +08:00
11 lines
239 B
Python
11 lines
239 B
Python
import faiss
|
|
import numpy as np
|
|
|
|
def write_index(index, file_name):
|
|
faiss.write_index(index, file_name)
|
|
|
|
def read_index(file_name):
|
|
return faiss.read_index(file_name)
|
|
|
|
def to_array(vec):
|
|
return np.asarray(vec).astype('float32') |