Skip to content

Commit

Permalink
Merge pull request #31 from qdrant/fix-defaults
Browse files Browse the repository at this point in the history
Consistent Default to v1.5
  • Loading branch information
NirantK authored Oct 18, 2023
2 parents 72591fe + b61f8a4 commit 1608599
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 43 deletions.
35 changes: 10 additions & 25 deletions docs/Getting Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,11 @@
"id": "b61c6552",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([384])\n"
"(384,)\n"
]
}
],
Expand All @@ -64,9 +57,9 @@
" \"This is an example document.\",\n",
" \"fastembed is supported by and maintained by Qdrant.\",\n",
"]\n",
"# Initialize the DefaultEmbedding class with the desired parameters\n",
"embedding_model = DefaultEmbedding(model_name=\"BAAI/bge-small-en\", max_length=512)\n",
"embeddings: List[np.ndarray] = embedding_model.embed(documents)\n",
"# Initialize the DefaultEmbedding class\n",
"embedding_model = DefaultEmbedding()\n",
"embeddings: List[np.ndarray] = list(embedding_model.embed(documents))\n",
"print(embeddings[0].shape)"
]
},
Expand Down Expand Up @@ -97,7 +90,7 @@
"source": [
"from typing import List\n",
"import numpy as np\n",
"from fastembed.embedding import DefaultEmbedding as Embedding"
"from fastembed.embedding import DefaultEmbedding"
]
},
{
Expand Down Expand Up @@ -171,20 +164,12 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"id": "8013eee9",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.\n"
]
}
],
"outputs": [],
"source": [
"embeddings: List[np.ndarray] = embedding_model.embed(documents)"
"embeddings: List[np.ndarray] = list(embedding_model.embed(documents))"
]
},
{
Expand All @@ -197,15 +182,15 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"id": "0d8c8e08",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([384])\n"
"(384,)\n"
]
}
],
Expand Down
Loading

0 comments on commit 1608599

Please sign in to comment.