Skip to content

Commit

Permalink
add rag solution nb
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesteckler committed Jan 22, 2024
1 parent 1c0b924 commit 5b6dd7a
Show file tree
Hide file tree
Showing 3 changed files with 1,073 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ kernels: \
reinforcement_learning_kernel \
tf_recommenders_kernel \
object_detection_kernel \
pytorch_kfp_kernel
pytorch_kfp_kernel \
langchain_kernel

.PHONY: clean
clean:
Expand All @@ -41,6 +42,10 @@ install:
precommit:
@pre-commit run --all-files

.PHONY: langchain_kernel
langchain_kernel:
./kernels/langchain.sh

.PHONY: reinforcement_learning_kernel
reinforcement_learning_kernel:
./kernels/reinforcement_learning.sh
Expand Down
33 changes: 33 additions & 0 deletions kernels/langchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
#
# To build the kernel: ./kernels/object_detection.sh
# To remove the kernel: ./kernels/object_detection.sh remove
#
# This scripts will create a ipython kernel named $ENVNAME

MODULE=vertex_genai
ENVNAME=langchain_kernel
REPO_ROOT_DIR="$(dirname $(cd $(dirname $BASH_SOURCE) && pwd))"

# Cleaning up the kernel and exiting if first arg is 'remove'
if [ "$1" == "remove" ]; then
echo Removing kernel $ENVNAME
jupyter kernelspec remove $ENVNAME
rm -r "$REPO_ROOT_DIR/notebooks/$MODULE/$ENVNAME"
exit 0
fi

cd $REPO_ROOT_DIR/notebooks/$MODULE

# Setup virtual env and kernel
python3 -m venv $ENVNAME --system-site-packages
source $ENVNAME/bin/activate
python -m ipykernel install --user --name=$ENVNAME

pip install -q -U pip
pip install langchain==0.0.217
pip install wikipedia==1.4.0
pip install chromadb==0.3.26
pip install google-cloud-aiplatform==1.26.1

deactivate
Loading

0 comments on commit 5b6dd7a

Please sign in to comment.