Last active
January 24, 2023 10:16
Revisions
-
jamescalam revised this gist
Jan 24, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,8 +36,8 @@ "index_id = \"youtube-search\"\n", "\n", "pinecone.init(\n", " api_key=\"YOUR_API_KEY\", # app.pinecone.io\n", " environment=\"YOUR_ENV\" # find next to API key\n", ")\n", "\n", "if index_id not in pinecone.list_indexes():\n", -
jamescalam revised this gist
Oct 14, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ } ], "source": [ "import pinecone # !pip install pinecone-client\n", "\n", "index_id = \"youtube-search\"\n", "\n", -
jamescalam created this gist
Oct 14, 2022 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,87 @@ { "cells": [ { "cell_type": "code", "execution_count": 10, "id": "dc0e39a1-266a-42ed-bede-e8dc3240476c", "metadata": {}, "outputs": [], "source": [ "dim = model.get_sentence_embedding_dimension()" ] }, { "cell_type": "code", "execution_count": 11, "id": "7b1d1ae0-6f9d-4906-b84c-7bee0985b1fa", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'dimension': 768,\n", " 'index_fullness': 0.0,\n", " 'namespaces': {},\n", " 'total_vector_count': 0}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pinecone\n", "\n", "index_id = \"youtube-search\"\n", "\n", "pinecone.init(\n", " api_key=\"<<YOUR_API_KEY>>\", # app.pinecone.io\n", " environment=\"us-west1-gcp\"\n", ")\n", "\n", "if index_id not in pinecone.list_indexes():\n", " pinecone.create_index(\n", " index_id,\n", " dim,\n", " metric=\"dotproduct\"\n", " )\n", "\n", "index = pinecone.Index(index_id)\n", "index.describe_index_stats()" ] } ], "metadata": { "environment": { "kernel": "python3", "name": "common-cu110.m95", "type": "gcloud", "uri": "gcr.io/deeplearning-platform-release/base-cu110:m95" }, "kernelspec": { "display_name": "Python 3.9.12 ('ml')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" }, "vscode": { "interpreter": { "hash": "b8e7999f96e1b425e2d542f21b571f5a4be3e97158b0b46ea1b2500df63956ce" } } }, "nbformat": 4, "nbformat_minor": 5 }