Skip to content

Commit 805a9a5

Browse files
v1.14: New pooling parameter for Hugging Face embedders (#3212)
1 parent a866442 commit 805a9a5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

reference/api/settings.mdx

+20-2
Original file line numberDiff line numberDiff line change
@@ -2435,10 +2435,11 @@ These embedder objects may contain the following fields:
24352435
| **`revision`** | String | Empty | Model revision hash |
24362436
| **`distribution`** | Object | Empty | Describes the natural distribution of search results. Must contain two fields, `mean` and `sigma`, each containing a numeric value between `0` and `1` |
24372437
| **`request`** | Object | Empty | A JSON value representing the request Meilisearch makes to the remote embedder |
2438-
| **`response`** | Object | Empty | A JSON value representing the request Meilisearch expects from the remote embedder |
2438+
| **`response`** | Object | Empty | A JSON value representing the response Meilisearch expects from the remote embedder |
24392439
| **`binaryQuantized`** | Boolean | Empty | Once set to `true`, irreversibly converts all vector dimensions to 1-bit values |
24402440
| **`indexingEmbedder`** | Object | Empty | Configures embedder to vectorize documents during indexing |
24412441
| **`searchEmbedder`** | Object | Empty | Configures embedder to vectorize search queries |
2442+
| **`pooling`** | String | `"useModel"` | Pooling method for Hugging Face embedders |
24422443

24432444
### Get embedder settings
24442445

@@ -2450,7 +2451,7 @@ Get the embedders configured for an index.
24502451

24512452
| Name | Type | Description |
24522453
| :---------------- | :----- | :------------------------------------------------------------------------ |
2453-
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
2454+
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
24542455

24552456
#### Example
24562457

@@ -2503,6 +2504,7 @@ Partially update the embedder settings for an index. When this setting is update
25032504
"response": { },
25042505
"headers": { },
25052506
"binaryQuantized": <Boolean>,
2507+
"pooling": <String>,
25062508
"indexingEmbedder": { },
25072509
"searchEmbedder": { }
25082510
}
@@ -2762,6 +2764,22 @@ This option can be useful when working with large Meilisearch projects. Consider
27622764
**Activating `binaryQuantized` is irreversible.** Once enabled, Meilisearch converts all vectors and discards all vector data that does fit within 1-bit. The only way to recover the vectors' original values is to re-vectorize the whole index in a new embedder.
27632765
</Capsule>
27642766

2767+
##### `pooling`
2768+
2769+
Configure how Meilisearch should merge individual tokens into a single embedding.
2770+
2771+
`pooling` must be one of the following strings:
2772+
2773+
- `"useModel"`: Meilisearch will fetch the pooling method from the model configuration. Default value for new embedders
2774+
- `"forceMean"`: always use mean pooling. Default value for embedders created in Meilisearch \<=v1.13
2775+
- `"forceCls"`: always use CLS pooling
2776+
2777+
If in doubt, use `"useModel"`. `"forceMean"` and `"forceCls"` are compatibility options that might be necessary for certain embedders and models.
2778+
2779+
`pooling` is optional for embedders with the `huggingFace` source.
2780+
2781+
`pooling` is invalid for all other embedder sources.
2782+
27652783
##### `indexingEmbedder` and `searchEmbedder` <NoticeTag type="experimental" label="experimental" />
27662784

27672785
When using a [composite embedder](#composite-embedders), configure separate embedders Meilisearch should use when vectorizing documents and search queries.

0 commit comments

Comments
 (0)