我想写一个
faiss
索引来备份到云端。
我可以使用 faiss.write_index(filename, f)
将其写入本地文件。
但是,我宁愿将其转储到内存以避免不必要的磁盘 IO。
我尝试传入
StringIO
或 ByteIO
流,但我从 swig
层收到这些错误。
TypeError: Wrong number or type of arguments for overloaded function 'write_index'.
Possible C/C++ prototypes are:
faiss::write_index(faiss::Index const *,char const *)
faiss::write_index(faiss::Index const *,FILE *)
faiss::write_index(faiss::Index const *,faiss::IOWriter *)
关于如何
write_index
记忆有什么想法吗?