Skip to content

Commit

Permalink
update on notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tahababou12 committed Nov 14, 2024
1 parent 804e8d1 commit ee77117
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 165 deletions.
Binary file added .DS_Store
Binary file not shown.
56 changes: 39 additions & 17 deletions full_basic_rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/taha/Desktop/BU/Academics/Masters/F24/Fidelity/_MSSPxFidelity/rag-langchain-base/venv/bin/python\n"
]
}
],
"source": [
"# Create virtual environment\n",
"! python -m venv venv\n",
Expand All @@ -32,9 +40,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"^C\n",
"\u001b[31mERROR: Operation cancelled by user\u001b[0m\u001b[31m\n",
"\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.3.1\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
]
}
],
"source": [
"# Install all packages\n",
"! pip install -r requirements.txt --quiet"
Expand All @@ -51,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -86,7 +106,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -104,7 +124,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -126,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -145,7 +165,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -206,22 +226,24 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This document is about providing instructions on how to structure and write code files, ensuring they are fully functional and compatible with each other. It emphasizes following a specific format for each file, starting with the \"entrypoint\" file and then moving on to imported files. The document also stresses the importance of including all necessary classes, functions, and methods, as well as making sure all parts of the architecture are present in the files.\n"
"ename": "AttributeError",
"evalue": "'str' object has no attribute 'pretty_print'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[10], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Question\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mrag_chain\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minvoke\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mWhat is this document about?\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpretty_print\u001b[49m()\n",
"\u001b[0;31mAttributeError\u001b[0m: 'str' object has no attribute 'pretty_print'"
]
}
],
"source": [
"# Question\n",
"ans = rag_chain.invoke(\"What is this document about?\")\n",
"\n",
"print(ans)"
"print(rag_chain.invoke(\"What is this document about?\"))"
]
}
],
Expand Down
Binary file added test/.DS_Store
Binary file not shown.
Binary file added test/scikit-learn/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 15 additions & 3 deletions tutorial_notebooks/[1]_rag_setup_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,30 @@
"\n",
"![Screenshot 2024-03-25 at 8.30.33 PM.png](attachment:c566957c-a8ef-41a9-9b78-e089d35cf0b7.png)\n",
"\n",
"## Pre-requisites"
"## Pre-requisites (optional but recommended)\n",
"\n",
"!! Only do the first step if you have never created a virtual environment for this repository. Otherwise, run `source venv/bin/activate` directly and make sure that the Python Kernel that you selected is from your `venv/` folder. !!"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3a88555a-53a5-4ab8-ba3d-e6dd3a26c71a",
"id": "706c950a",
"metadata": {},
"outputs": [],
"source": [
"# Create virtual environment\n",
"! python -m venv venv\n",
"! python -m venv venv"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3a88555a-53a5-4ab8-ba3d-e6dd3a26c71a",
"metadata": {},
"outputs": [],
"source": [
"# Activate virtual Python environment\n",
"! source venv/bin/activate\n",
"! which python #make sure that the end of your path output contains \"...venv/bin/python\""
]
Expand Down
Loading

0 comments on commit ee77117

Please sign in to comment.