Skip to content

Commit

Permalink
Added tests for NVFoundationLLMService and FaissVectorDbService (#…
Browse files Browse the repository at this point in the history
…1714)

## Description
<!-- Note: The pull request title will be included in the CHANGELOG. -->
<!-- Provide a standalone description of changes in this PR. -->
<!-- Reference any issues closed by this PR with "closes #1234". All PRs
should have an issue they close-->

- Added tests for NVFoundation (test_nvfoundation_llm_client.py created)
- Added tests for FAISS (test_faiss_vector_db_service.py created)
- Changes to faiss_vdb_service.py (implemented more methods - insert,
delete, count, create)
- Changes to nvfoundation_llm_service.py (api key changes in
NVFoundationLLMService)

Closes 

## By Submitting this PR I confirm:
- I am familiar with the [Contributing
Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these
changes.
- When the PR is ready for review, the documentation is up to date with
these changes.
  • Loading branch information
mdemoret-nv authored Jun 12, 2024
2 parents 61fda48 + aeb0544 commit 9f3b8c1
Show file tree
Hide file tree
Showing 16 changed files with 834 additions and 581 deletions.
17 changes: 10 additions & 7 deletions conda/environments/all_cuda-121_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- appdirs
- arxiv=1.4
- automake
- beautifulsoup4
- beautifulsoup4=4.12
- benchmark=1.8.3
- boost-cpp=1.84
- boto3
Expand Down Expand Up @@ -69,7 +69,7 @@ dependencies:
- numexpr
- numpydoc=1.5
- nvtabular=23.08.00
- onnx
- onnx=1.15
- openai=1.13
- papermill=2.4.0
- pip
Expand All @@ -95,11 +95,11 @@ dependencies:
- rdma-core>=48
- requests
- requests-cache=1.1
- requests-toolbelt
- requests-toolbelt=1.0
- s3fs=2023.12.2
- scikit-build=0.17.6
- scikit-learn=1.3.2
- sentence-transformers
- sentence-transformers=2.7
- sphinx
- sphinx_rtd_theme
- sqlalchemy
Expand All @@ -117,15 +117,18 @@ dependencies:
- pip:
- --find-links https://data.dgl.ai/wheels-test/repo.html
- --find-links https://data.dgl.ai/wheels/cu121/repo.html
- PyMuPDF==1.23.*
- PyMuPDF==1.23.21
- databricks-cli < 0.100
- databricks-connect
- dgl==2.0.0
- dglgo
- google-search-results==2.4
- langchain==0.1.9
- faiss-gpu==1.7.*
- google-search-results==2.4.*
- langchain-nvidia-ai-endpoints==0.0.11
- langchain==0.1.16
- milvus==2.3.5
- nemollm
- nemollm==0.3.5
- pymilvus==2.3.6
- pytest-kafka==0.6.0
name: all_cuda-121_arch-x86_64
2 changes: 0 additions & 2 deletions conda/environments/dev_cuda-121_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ channels:
dependencies:
- appdirs
- automake
- beautifulsoup4
- benchmark=1.8.3
- boost-cpp=1.84
- breathe=4.35.0
Expand Down Expand Up @@ -78,7 +77,6 @@ dependencies:
- rdma-core>=48
- requests
- requests-cache=1.1
- requests-toolbelt
- scikit-build=0.17.6
- scikit-learn=1.3.2
- sphinx
Expand Down
18 changes: 10 additions & 8 deletions conda/environments/examples_cuda-121_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- anyio>=3.7
- appdirs
- arxiv=1.4
- beautifulsoup4
- beautifulsoup4=4.12
- boto3
- click >=8
- cuml=24.02.*
Expand All @@ -35,7 +35,7 @@ dependencies:
- numexpr
- numpydoc=1.5
- nvtabular=23.08.00
- onnx
- onnx=1.15
- openai=1.13
- papermill=2.4.0
- pip
Expand All @@ -48,10 +48,10 @@ dependencies:
- pytorch=*=*cuda*
- requests
- requests-cache=1.1
- requests-toolbelt
- requests-toolbelt=1.0
- s3fs=2023.12.2
- scikit-learn=1.3.2
- sentence-transformers
- sentence-transformers=2.7
- sqlalchemy
- tqdm=4
- transformers=4.36.2
Expand All @@ -61,14 +61,16 @@ dependencies:
- pip:
- --find-links https://data.dgl.ai/wheels-test/repo.html
- --find-links https://data.dgl.ai/wheels/cu121/repo.html
- PyMuPDF==1.23.21
- PyMuPDF==1.23.*
- databricks-cli < 0.100
- databricks-connect
- dgl==2.0.0
- dglgo
- google-search-results==2.4
- langchain==0.1.9
- faiss-gpu==1.7.*
- google-search-results==2.4.*
- langchain-nvidia-ai-endpoints==0.0.11
- langchain==0.1.16
- milvus==2.3.5
- nemollm
- nemollm==0.3.5
- pymilvus==2.3.6
name: examples_cuda-121_arch-x86_64
2 changes: 0 additions & 2 deletions conda/environments/runtime_cuda-121_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ channels:
- pytorch
dependencies:
- appdirs
- beautifulsoup4
- click >=8
- datacompy=0.10
- dill=0.3.7
Expand All @@ -30,7 +29,6 @@ dependencies:
- pytorch=*=*cuda*
- requests
- requests-cache=1.1
- requests-toolbelt
- scikit-learn=1.3.2
- sqlalchemy
- tqdm=4
Expand Down
79 changes: 21 additions & 58 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ files:
- docs
- example-dfp-prod
- example-gnn
- example-llm-agents
- example-llm-completion
- example-llm-rag
- example-llm-vdb-upload
- example-llms
- python
- runtime
- test_python_morpheus
Expand Down Expand Up @@ -86,10 +83,7 @@ files:
- development
- example-dfp-prod
- example-gnn
- example-llm-agents
- example-llm-completion
- example-llm-rag
- example-llm-vdb-upload
- example-llms
- python
- runtime
- test_python_morpheus
Expand All @@ -107,10 +101,7 @@ files:
- docs
- example-dfp-prod
- example-gnn
- example-llm-agents
- example-llm-completion
- example-llm-rag
- example-llm-vdb-upload
- example-llms
- python
- runtime

Expand All @@ -132,10 +123,7 @@ files:
- cve-mitigation
- example-dfp-prod
- example-gnn
- example-llm-agents
- example-llm-completion
- example-llm-rag
- example-llm-vdb-upload
- example-llms
- python
- runtime

Expand Down Expand Up @@ -249,7 +237,6 @@ dependencies:
- &dill dill=0.3.7
- &scikit-learn scikit-learn=1.3.2
- appdirs
- beautifulsoup4
- datacompy=0.10
- elasticsearch==8.9.0
- feedparser=6.0.10
Expand All @@ -264,7 +251,6 @@ dependencies:
- pytorch=*=*cuda*
- requests
- requests-cache=1.1
- requests-toolbelt # Transitive dep needed by nemollm, specified here to ensure we get a compatible version
- sqlalchemy
- tqdm=4
- typing_utils=0.1
Expand Down Expand Up @@ -318,55 +304,32 @@ dependencies:
- dgl==2.0.0
- dglgo

example-llm-agents:
example-llms:
common:
- output_types: [conda]
packages:
- &grpcio-status grpcio-status==1.59
- &transformers transformers=4.36.2 # newer versions are incompatible with our pinned version of huggingface_hub
- huggingface_hub=0.20.2 # work-around for https://github.com/UKPLab/sentence-transformers/issues/1762
- numexpr
- sentence-transformers
- pip
- pip:
- &langchain langchain==0.1.9
- nemollm

example-llm-completion:
common:
- output_types: [conda]
packages:
- *grpcio-status
- &arxiv arxiv=1.4
- &newspaper3k newspaper3k=0.2
- &pypdf pypdf=3.17.4

example-llm-rag:
common:
- output_types: [conda]
packages:
- *grpcio-status
- anyio>=3.7
- arxiv=1.4
- beautifulsoup4=4.12
- grpcio-status==1.59
- huggingface_hub=0.20.2 # work-around for https://github.com/UKPLab/sentence-transformers/issues/1762
- jsonpatch>=1.33
- newspaper3k=0.2
- numexpr
- onnx=1.15
- openai=1.13
- pypdf=3.17.4
- requests-toolbelt=1.0 # Transitive dep needed by nemollm, specified here to ensure we get a compatible version
- sentence-transformers=2.7
- pip
- pip:
- *langchain
- google-search-results==2.4

example-llm-vdb-upload:
common:
- output_types: [conda]
packages:
- *arxiv
- *grpcio-status
- *newspaper3k
- *pypdf
- onnx
- pip
- pip:
- PyMuPDF==1.23.21
- *langchain
- faiss-gpu==1.7.*
- google-search-results==2.4.*
- langchain-nvidia-ai-endpoints==0.0.11
- langchain==0.1.16
- nemollm==0.3.5
- PyMuPDF==1.23.*

model-training-tuning:
common:
Expand Down
2 changes: 1 addition & 1 deletion morpheus.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@
"tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": true,
"python.testing.unittestEnabled": false,
"rewrap.wrappingColumn": 120,
"testMate.cpp.debug.configTemplate": {
"args": "${argsArray}",
Expand Down
Loading

0 comments on commit 9f3b8c1

Please sign in to comment.