Housekeeping

This commit is contained in:
Edward Donner
2025-09-20 16:25:21 -04:00
parent d72fccaaeb
commit c6292232e8
7 changed files with 43 additions and 73 deletions

View File

@@ -358,7 +358,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.12"
"version": "3.11.13"
}
},
"nbformat": 4,

View File

@@ -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,

View File

@@ -475,7 +475,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.12"
"version": "3.11.13"
}
},
"nbformat": 4,