Skip to content

Commit

Permalink
specifies vector dtype when creating byte vectors in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-cechmanek committed Sep 22, 2024
1 parent 0b98281 commit d289a44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/examples/openai_qna.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@
"api_key = os.getenv(\"OPENAI_API_KEY\") or getpass.getpass(\"Enter your OpenAI API key: \")\n",
"oaip = OpenAITextVectorizer(EMBEDDINGS_MODEL, api_config={\"api_key\": api_key})\n",
"\n",
"chunked_data[\"embedding\"] = oaip.embed_many(chunked_data[\"content\"].tolist(), as_buffer=True)\n",
"chunked_data[\"embedding\"] = oaip.embed_many(chunked_data[\"content\"].tolist(), as_buffer=True, dtype=\"float32\")\n",
"chunked_data"
]
},
Expand Down Expand Up @@ -1073,7 +1073,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.12.2"
},
"orig_nbformat": 4
},
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/vectorizers_04.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
"outputs": [],
"source": [
"# You can also create many embeddings at once\n",
"embeddings = hf.embed_many(sentences, as_buffer=True)\n"
"embeddings = hf.embed_many(sentences, as_buffer=True, dtype=\"float32\")\n"
]
},
{
Expand Down

0 comments on commit d289a44

Please sign in to comment.