Skip to content

Commit

Permalink
fix: Update Embedding Model to text-embedding-004 (GoogleCloudPlatf…
Browse files Browse the repository at this point in the history
  • Loading branch information
holtskinner authored Nov 14, 2024
1 parent 1e481eb commit dd9e36b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
"id": "0ExfeGcm9Iu5"
},
"source": [
"| | | |\n",
"|-|-|-|\n",
"|Author(s) | [Logan Ramalingam](https://github.com/logan-google)"
"| | |\n",
"|-|-|\n",
"|Author(s) | [Logan Ramalingam](https://github.com/logan-google) |"
]
},
{
Expand Down Expand Up @@ -255,10 +255,10 @@
"LLM_MODEL_ID = \"llm_gemini\" # @param {type:\"string\"}\n",
"\n",
"# Embeddings Model to use\n",
"EMBEDDINGS_ENDPOINT_TYPE = \"textembedding-gecko@002\" # @param {type:\"string\"}\n",
"EMBEDDINGS_ENDPOINT_TYPE = \"text-embedding-004\" # @param {type:\"string\"}\n",
"\n",
"# LLM Model to use\n",
"LLM_ENDPOINT_TYPE = \"gemini-pro\" # @param {type:\"string\"}"
"LLM_ENDPOINT_TYPE = \"gemini-1.5-pro\" # @param {type:\"string\"}"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions search/custom-embeddings/custom_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"outputs": [],
"source": [
"# Load the text embeddings model\n",
"model = TextEmbeddingModel.from_pretrained(\"textembedding-gecko@003\")"
"model = TextEmbeddingModel.from_pretrained(\"text-embedding-004\")"
]
},
{
Expand All @@ -313,7 +313,6 @@
" embs = []\n",
" for i in tqdm(range(0, len(texts), batch_size)):\n",
" # Create embeddings optimized for document retrieval\n",
" # (supported in textembedding-gecko@002 and later)\n",
" result = model.get_embeddings(\n",
" [\n",
" TextEmbeddingInput(text=text, task_type=\"RETRIEVAL_DOCUMENT\")\n",
Expand Down

0 comments on commit dd9e36b

Please sign in to comment.