thunlp / InfLLM

The code of our paper "InfLLM: Unveiling the Intrinsic Capacity of LLMs for Understanding Extremely Long Sequences with Training-Free Memory"
MIT License
269 stars 21 forks source link

是否可以添加faiss向量库的保存和加载 #26

Closed Minami-su closed 5 months ago

Minami-su commented 5 months ago

在上次对话结束后保存储存kv_cache的faiss,然后可以在下次对话中载入上次会话的kv_cache faiss

guyan364 commented 5 months ago

你好,faiss 本身作为可选项,目前没有计划拓展。你可以自行对 kv cache 进行操作实现 save/load。https://github.com/facebookresearch/faiss/wiki/Index-IO,-cloning-and-hyper-parameter-tuning#io-and-deep-copying-indexes

00ffcc commented 3 months ago

好像用torch.save就可以保存past_key_values,我实现了一下 QQ截图20240519211244

Minami-su commented 3 months ago

好像用torch.save就可以保存past_key_values,我实现了一下 QQ截图20240519211244

好厉害,非常感谢