Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rag solution nb #413

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading