FlagEmbedding icon indicating copy to clipboard operation
FlagEmbedding copied to clipboard

Does visualized bge support the embedding of multiple pictures and one text?

Open babytdream opened this issue 1 year ago • 1 comments

A data include some pictures and a text. Like: image1,image2,image3 and a text. Can I use visualized bge? How to use, thank you!

def encode(self, image=None, text=None):
        # used for simple inference
        if image is not None:
            image = self.preprocess_val(Image.open(image)).unsqueeze(0)

            if text is not None:
                text = self.tokenizer(text, return_tensors="pt", padding=True)
                return self.encode_mm(image.to(self.device), text.to(self.device))
            else:
                return self.encode_image(image.to(self.device))
        else:
            if text is not None:
                text = self.tokenizer(text, return_tensors="pt", padding=True)
                return self.encode_text(text.to(self.device))
            else:
                return None

babytdream avatar Jul 17 '24 02:07 babytdream

Hello, Visualized BGE currently does not support multiple image input.

JUNJIE99 avatar Jul 18 '24 05:07 JUNJIE99