[Feature]: Multioutput models

未关闭
#485 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 4 天内回复

@joein 已经在做这个了。

开始于 2026年10月6日。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
numpy, python

调研方向

该 issue 未指定文件或测试。首先定位默认模型接口以及返回数组的推理路径,然后比较所述的 embedding 和 pooling 情况;完成标准是确定一个 Multioutput 接口,使其针对预期情况支持以 dict 或 model-output 返回。

由索引模型根据 Issue 内容生成。

描述

What feature would you like to request?

In some cases our default model interface returning an array of numpy arrays is not enough
There are scenarios when we want to return more than that either in order to save resources or just because there is no other way.

An example of the first case is when models can return several types of embeddings using the same backbone but different head layers, e.g. baai/bge-m3.
Or when it is desired to obtain not only pooled embedding, but also token embeddings of the penultimate layer.

Another example is colpali-like models, it is not always possible to build index on colpali embeddings since of the huge resources consumption and thus it makes it difficult to use colpali as the first stage retriever.
Instead, first stage retrieval can be implemented via colpali embeddings pooled by either rows or columns.

In the particular case of colpali, it is possible to do the pooling after inference is completed and embeddings were returned, since the number of patches into which colpali preprocessor breaks an image is known beforehand.
However, with colpali-inspired models like colqwen, it is not possible to do the pooling afterwards, because the number of patches into which these models break an image is dynamic, thus, we need to know an image size to get the number of patches.

In order to handle these cases, we want to introduce new family of Multioutput classes with an interface allowing to return either dict or special model output objects.

Is there any additional information you would like to provide?

No response

主要语言
Python
星标
3.3k
派生
314
平均合并
5 天 7 小时
30 天内合并 PR
23

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

qdrant/fastembed 的其他 Issue

查看 qdrant/fastembed 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。