meta-llama / llama-stack

Composable building blocks to build Llama Apps
MIT License
4.66k stars 599 forks source link

fix faiss serialize and serialize of index #464

Closed dineshyv closed 1 week ago

dineshyv commented 1 week ago

faiss serialize index returns a np object, that we first need to save to buffer and then write to sqllite. Since we are using json, we need to base64 encode the data.

Same in the read path, we base64 decode and read into np array and then call into deserialize index.

tests: torchrun $CONDA_PREFIX/bin/pytest -v -s -m "faiss" llama_stack/providers/tests/memory/test_memory.py