mirror of
https://github.com/hwchase17/langchain.git
synced 2026-05-12 17:57:22 +00:00
nomic[patch]: release 0.0.2, dimensionality (#17534)
- nomic[patch]: release 0.0.2 - x
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
"source": [
|
||||
"from langchain_nomic.embeddings import NomicEmbeddings\n",
|
||||
"\n",
|
||||
"embeddings = NomicEmbeddings(model=\"nomic-embed-text-v1\")"
|
||||
"embeddings = NomicEmbeddings(model=\"nomic-embed-text-v1.5\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -106,6 +106,28 @@
|
||||
" [\"This is a content of the document\", \"This is another document\"]\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "7a331dc3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Custom Dimensionality\n",
|
||||
"\n",
|
||||
"Nomic's `nomic-embed-text-v1.5` model was [trained with Matryoshka learning](https://blog.nomic.ai/posts/nomic-embed-matryoshka) to enable variable-length embeddings with a single model. This means that you can specify the dimensionality of the embeddings at inference time. The model supports dimensionality from 64 to 768."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "993f65c8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"embeddings = NomicEmbeddings(model=\"nomic-embed-text-v1.5\", dimensionality=256)\n",
|
||||
"\n",
|
||||
"embeddings.embed_query(\"My query to look up\")"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user