attu icon indicating copy to clipboard operation
attu copied to clipboard

Can you add an interface to get the embedding array from the remote end?

Open become-nice opened this issue 2 years ago • 2 comments

Describe the feature:   When I use attu to search, I often need to use the model to embedding the search content first, and then convert the vector result to the format before querying. Can you provide an interface so that I can send the embedding content to the remote machine, and then I return a vector array to attu. Attu doesn't care how I parse it, you just need to send the information to the specified location.

become-nice avatar Jul 21 '23 03:07 become-nice

nice idea, let me think about it how to design it.

shanghaikid avatar Jul 21 '23 03:07 shanghaikid

@shanghaikid Maybe this could be a good start referred: https://github.com/botisan-ai/sentence-transformers.js/blob/main/src/index.ts https://huggingface.co/docs/transformers.js/api/pipelines

import { env } from "@xenova/transformers";

import { SentenceTransformer } from "./model.js";

async function main() {
  console.log(env);
  const sentenceTransformer = await SentenceTransformer.from_pretrained(
    "Supabase/bge-small-en"
  );
  await sentenceTransformer.encode(["Hello world", "How are you guys doing?"]);
}

main();

DaiZack avatar Jan 22 '24 19:01 DaiZack