Skip to content

formally support int8 and uint8 within langchain and 2 distance metrics #561

@BBC-Esq

Description

@BBC-Esq

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:

  1. Both langchain and sentence transformers allow a model to be run in float32, bfloat16, and float16.
  2. Sentence Transformers "encode" method only supports float32 (and certain quantizations), which results in the embeddings themselves being in float32.
  3. 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),

  1. Relatively newer versions of sentence-transformers support int8, uint8, binary, ubinary. Pull request here

  2. Tiledb seems to support int8 and uint8 but not the other two.

  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions