GLLM Retrieval
Description
A library containing retrieval related components in Gen AI applications.
Installation
You can install Python using Miniconda.
- Make sure you're in the
base
conda environment:
conda activate
You can install Poetry using cURL (you need Python to install Poetry):
curl -sSL https://install.python-poetry.org | python3 -
- Install the library using Poetry:
poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git#subdirectory=libs/gllm-retrieval"
poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git@gllm_retrieval-v0.0.1-beta.1#subdirectory=libs/gllm-retrieval"
poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git@<BRANCH NAME>#subdirectory=libs/gllm-retrieval"
poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git#subdirectory=libs/gllm-retrieval" --extras "extra1 extra2"
Available extras:
flag_embedding
: Install FlagEmbedding Reranker dependencies
- At this step, you can deactivate Miniconda environment as Poetry will create and manage its own virtual environment for you.
conda deactivate
Managing Dependencies
- Go to root folder of
gllm-retrieval
module, e.g. cd libs/gllm-retrieval
.
- Run
poetry shell
to create a virtual environment.
- Run
poetry lock
to create a lock file if you haven't done it yet.
- Run
poetry install
to install the gllm-retrieval
requirements for the first time.
- Run
poetry update
if you update any dependency module version at pyproject.toml
.
Contributing
Please refer to this Python Style Guide
to get information about code style, documentation standard, and SCA that you need to use when contributing to this project
- Activate
pre-commit
hooks using pre-commit install
- Run
poetry shell
to create a virtual environment.
- Run
poetry lock
to create a lock file if you haven't done it yet.
- Run
poetry install
to install the gllm-retrieval
requirements for the first time.
- Run
poetry install --all-extras
to install optional library (elasticsearch, etc).
- Run
which python
to get the path to be referenced at Visual Studio Code interpreter path (Ctrl
+Shift
+P
or Cmd
+Shift
+P
)
- Try running the unit test to see if it's working:
poetry run pytest -s tests/unit_tests/