3、使用 DocArray 和 Jina 为 BLIP-2 提供服务 由于BLIP-2 使用 LLM,因此它配备了不同的开源语言模型(即 flan-t5 和 opt)。 在本博客中,我们将使用 flan-t5-xl。 让我们从安装依赖项开始: pip install jina torch git+https://github.com/huggingface/transformers pillow 然后,我们可以初始化一个加载模型...
main blip2-flan-t5-xl / pytorch_model.bin.index.json pytorch_model.bin.index.json 125.06 KB 一键复制 编辑 原始数据 按行查看 历史 Niels Rogge 提交于 2年前 . Upload Blip2ForConditionalGeneration 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656...
answer:strclassBlip2Executor(Executor):def__init__(self, **kwargs):super().__init__(**kwargs) self.processor = Blip2Processor.from_pretrained("Salesforce/blip2-flan-t5-xl") self.model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-flan-t5-xl", torch_dtype=torch.float...
15. 16. 17.