Skip to content

Commit

Permalink
Merge pull request #413 from GoogleCloudPlatform/rag
Browse files Browse the repository at this point in the history
add rag solution nb
  • Loading branch information
kylesteckler authored Feb 8, 2024
2 parents c130545 + 543bb98 commit f3497a5
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 @@ -19,7 +19,8 @@ kernels: \
tf_recommenders_kernel \
object_detection_kernel \
pytorch_kfp_kernel \
gemini_kernel
langchain_kernel \
gemini_kernel

.PHONY: clean
clean:
Expand All @@ -42,6 +43,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 f3497a5

Please sign in to comment.