Sorry for the overlapping posts, but I thought it prudent to initiate a separate issue if this is going to be worked on:
Here's a summary:
- Both langchain and sentence transformers allow a model to be run in float32, bfloat16, and float16.
- Sentence Transformers "encode" method only supports float32 (and certain quantizations), which results in the embeddings themselves being in float32.
Tiledb.py, langchain's integration with the tiledb library, automatically converts embeddings to float32 here:
np.array([np.array(embedding).astype(np.float32)]).astype(np.float32),
-
Relatively newer versions of sentence-transformers support int8, uint8, binary, ubinary. Pull request here
-
Tiledb seems to support int8 and uint8 but not the other two.
-
Again, langchain's integration of tiledb within tiledb.py doesn't distinguish and converts everything to float32.
Does that succinctly summarize the current state of affairs? Is it possible to at least modify tiledb.py to formally support int8 and uint8 if not the other two? I noticed that @nikolaos did the initial integration in November, 2023. Is he still around at the company by chance? lol.
Here is the related "issue" where I realized this for peoples' cross reference: TileDB-Inc/TileDB-Py#2130 (comment)
Sorry for the overlapping posts, but I thought it prudent to initiate a separate issue if this is going to be worked on:
Here's a summary:
Tiledb.py, langchain's integration with thetiledblibrary, automatically converts embeddings tofloat32here:np.array([np.array(embedding).astype(np.float32)]).astype(np.float32),Relatively newer versions of
sentence-transformerssupportint8,uint8,binary,ubinary. Pull request hereTiledbseems to supportint8anduint8but not the other two.Again, langchain's integration of
tiledbwithintiledb.pydoesn't distinguish and converts everything tofloat32.Does that succinctly summarize the current state of affairs? Is it possible to at least modify tiledb.py to formally support
int8anduint8if not the other two? I noticed that @nikolaos did the initial integration in November, 2023. Is he still around at the company by chance? lol.Here is the related "issue" where I realized this for peoples' cross reference: TileDB-Inc/TileDB-Py#2130 (comment)