@@ -29,7 +29,7 @@ or JSON fields, Redis can retrieve documents that closely match the query in ter
29
29
of their meaning.
30
30
31
31
The example below uses the [ HuggingFace] ( https://huggingface.co/ ) model
32
- [ ` all-mpnet-base -v2 ` ] ( https://huggingface.co/sentence-transformers/all-mpnet-base -v2 )
32
+ [ ` all-MiniLM-L6 -v2 ` ] ( https://huggingface.co/sentence-transformers/all-MiniLM-L6 -v2 )
33
33
to generate the vector embeddings to store and index with Redis Query Engine.
34
34
35
35
## Initialize
@@ -66,7 +66,7 @@ use Predis\Command\Argument\Search\SchemaFields\VectorField;
66
66
## Create a tokenizer instance
67
67
68
68
The code below shows how to use the
69
- [ ` all-mpnet-base -v2 ` ] ( https://huggingface.co/sentence-transformers/all-mpnet-base -v2 )
69
+ [ ` all-MiniLM-L6 -v2 ` ] ( https://huggingface.co/sentence-transformers/all-MiniLM-L6 -v2 )
70
70
tokenizer to generate the embeddings. The vectors that represent the
71
71
embeddings have 384 dimensions, regardless of the length of the input
72
72
text. Here, the ` pipeline() ` call creates the ` $extractor ` function that
@@ -104,7 +104,7 @@ the original text content. The `embedding` field specifies
104
104
indexing, the
105
105
[ L2] ({{< relref "/develop/interact/search-and-query/advanced-concepts/vectors#distance-metrics" >}})
106
106
vector distance metric, ` Float32 ` values to represent the vector's components,
107
- and 384 dimensions, as required by the ` all-mpnet-base -v2 ` embedding model.
107
+ and 384 dimensions, as required by the ` all-MiniLM-L6 -v2 ` embedding model.
108
108
109
109
The ` CreateArguments ` parameter to [ ` ftcreate() ` ] ({{< relref "/commands/ft.create" >}})
110
110
specifies hash objects for storage and a prefix ` doc: ` that identifies the hash objects
@@ -144,7 +144,7 @@ embeddings from multiple strings parameters at once, so it returns an array of
144
144
embedding vectors. Here, there is only one embedding in the returned array.
145
145
The ` normalize: ` and ` pooling: ` named parameters relate to details
146
146
of the embedding model (see the
147
- [ ` all-mpnet-base -v2 ` ] ( https://huggingface.co/sentence-transformers/all-mpnet-base -v2 )
147
+ [ ` all-MiniLM-L6 -v2 ` ] ( https://huggingface.co/sentence-transformers/all-MiniLM-L6 -v2 )
148
148
page for more information).
149
149
150
150
To add an embedding as a field of a hash object, you must encode the
@@ -244,7 +244,7 @@ for ($i = 1; $i < ($numResults * 2 + 1); $i += 2) {
244
244
Assuming you have added the code from the steps above to your source file,
245
245
it is now ready to run, but note that it may take a while to complete when
246
246
you run it for the first time (which happens because the tokenizer must download the
247
- ` all-mpnet-base -v2 ` model data before it can
247
+ ` all-MiniLM-L6 -v2 ` model data before it can
248
248
generate the embeddings). When you run the code, it outputs the following result text:
249
249
250
250
```
0 commit comments