Housekeeping
This commit is contained in:
@@ -168,13 +168,13 @@
|
||||
"# Put the chunks of data into a Vector Store that associates a Vector Embedding with each chunk\n",
|
||||
"# Chroma is a popular open source Vector Database based on SQLLite\n",
|
||||
"\n",
|
||||
"embeddings = OpenAIEmbeddings()\n",
|
||||
"# embeddings = OpenAIEmbeddings()\n",
|
||||
"\n",
|
||||
"# If you would rather use the free Vector Embeddings from HuggingFace sentence-transformers\n",
|
||||
"# Then replace embeddings = OpenAIEmbeddings()\n",
|
||||
"# with:\n",
|
||||
"# from langchain.embeddings import HuggingFaceEmbeddings\n",
|
||||
"# embeddings = HuggingFaceEmbeddings(model_name=\"sentence-transformers/all-MiniLM-L6-v2\")\n",
|
||||
"from langchain.embeddings import HuggingFaceEmbeddings\n",
|
||||
"embeddings = HuggingFaceEmbeddings(model_name=\"sentence-transformers/all-MiniLM-L6-v2\")\n",
|
||||
"\n",
|
||||
"# Delete if already exists\n",
|
||||
"\n",
|
||||
@@ -329,6 +329,23 @@
|
||||
"</table>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3dd0a478-bde4-41f8-8fe8-a35d3246e1b6",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Alternative: to use a free open-source model instead of OpenAI in the next cell\n",
|
||||
"\n",
|
||||
"First run this in a cell: `!pip install langchain-ollama`\n",
|
||||
"\n",
|
||||
"Then replace `llm = ChatOpenAI(temperature=0.7, model_name=MODEL)` with:\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
"from langchain_ollama import ChatOllama\n",
|
||||
"llm = ChatOllama(temperature=0.7, model=\"llama3.2\")\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
Reference in New Issue
Block a user