|
@@ -104,11 +104,9 @@
|
|
|
"\n",
|
|
|
"At the time of writing this notebook the following Llama models are available on OctoAI:\n",
|
|
|
"* llama-2-13b-chat-fp16\n",
|
|
|
- "* llama-2-70b-chat-int4\n",
|
|
|
"* llama-2-70b-chat-fp16\n",
|
|
|
"* codellama-7b-instruct-fp16\n",
|
|
|
"* codellama-13b-instruct-fp16\n",
|
|
|
- "* codellama-34b-instruct-int4\n",
|
|
|
"* codellama-34b-instruct-fp16\n",
|
|
|
"* codellama-70b-instruct-fp16"
|
|
|
]
|
|
@@ -217,10 +215,9 @@
|
|
|
"source": [
|
|
|
"With the data set up, we create a vector store for the data and a query engine for it.\n",
|
|
|
"\n",
|
|
|
- "For our embeddings we will use `HuggingFaceEmbeddings` whose default embedding model is sentence-transformers/all-mpnet-base-v2. This model provides a good balance between speed and performance.\n",
|
|
|
- "To change the default model, call `HuggingFaceEmbeddings(model_name=<another_embedding_model>)`. \n",
|
|
|
+ "For our embeddings we will use `OctoAIEmbeddings` whose default embedding model is GTE-Large. This model provides a good balance between speed and performance.\n",
|
|
|
"\n",
|
|
|
- "For more info see https://huggingface.co/blog/mteb. "
|
|
|
+ "For more info see https://octoai.cloud/tools/text/embeddings?mode=demo&model=thenlper%2Fgte-large. "
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -230,12 +227,14 @@
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
- "# use HuggingFace embeddings \n",
|
|
|
- "from langchain.embeddings.huggingface import HuggingFaceEmbeddings\n",
|
|
|
+ "# use OctoAI embeddings \n",
|
|
|
+ "from langchain_community.embeddings import OctoAIEmbeddings\n",
|
|
|
"from llama_index.embeddings import LangchainEmbedding\n",
|
|
|
"\n",
|
|
|
"\n",
|
|
|
- "embeddings = LangchainEmbedding(HuggingFaceEmbeddings())\n",
|
|
|
+ "embeddings = LangchainEmbedding(OctoAIEmbeddings(\n",
|
|
|
+ " endpoint_url=\"https://text.octoai.run/v1/embeddings\"\n",
|
|
|
+ "))\n",
|
|
|
"print(embeddings)\n",
|
|
|
"\n",
|
|
|
"# create a ServiceContext instance to use Llama2 and custom embeddings\n",
|