From 0e1986e2428d82c52523d4a82afd807dc11d9812 Mon Sep 17 00:00:00 2001 From: Madeesh Kannan Date: Tue, 19 Mar 2024 13:26:26 +0100 Subject: [PATCH] docs: Update docstrings of Nvidia integrations (#599) --- .../components/embedders/nvidia/document_embedder.py | 6 +++--- .../components/embedders/nvidia/text_embedder.py | 6 +++--- .../components/generators/nvidia/generator.py | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/document_embedder.py b/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/document_embedder.py index 5b62da87b..da181bd22 100644 --- a/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/document_embedder.py +++ b/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/document_embedder.py @@ -14,11 +14,11 @@ class NvidiaDocumentEmbedder: """ A component for embedding documents using embedding models provided by [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) - and NVIDIA NeMo Inference Microservices. + and NVIDIA Inference Microservices. Usage example: ```python - from haystack_integrations.components.embedders.nvidia import NvidiaDocumentEmbedder, NvidiaEmbeddingModel + from haystack_integrations.components.embedders.nvidia import NvidiaDocumentEmbedder doc = Document(content="I love pizza!") @@ -50,7 +50,7 @@ def __init__( :param api_key: API key for the NVIDIA AI Foundation Endpoints. :param api_url: - Custom API URL for the NVIDIA NeMo Inference Microservices. + Custom API URL for the NVIDIA Inference Microservices. :param prefix: A string to add to the beginning of each text. :param suffix: diff --git a/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/text_embedder.py b/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/text_embedder.py index 79dda0d81..6af5ba25f 100644 --- a/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/text_embedder.py +++ b/integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/text_embedder.py @@ -13,14 +13,14 @@ class NvidiaTextEmbedder: """ A component for embedding strings using embedding models provided by [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) - and NVIDIA NeMo Inference Microservices. + and NVIDIA Inference Microservices. For models that differentiate between query and document inputs, this component embeds the input string as a query. Usage example: ```python - from haystack_integrations.components.embedders.nvidia import NvidiaTextEmbedder, NvidiaEmbeddingModel + from haystack_integrations.components.embedders.nvidia import NvidiaTextEmbedder text_to_embed = "I love pizza!" @@ -47,7 +47,7 @@ def __init__( :param api_key: API key for the NVIDIA AI Foundation Endpoints. :param api_url: - Custom API URL for the NVIDIA NeMo Inference Microservices. + Custom API URL for the NVIDIA Inference Microservices. :param prefix: A string to add to the beginning of each text. :param suffix: diff --git a/integrations/nvidia/src/haystack_integrations/components/generators/nvidia/generator.py b/integrations/nvidia/src/haystack_integrations/components/generators/nvidia/generator.py index f2f94c3a2..b6db399e6 100644 --- a/integrations/nvidia/src/haystack_integrations/components/generators/nvidia/generator.py +++ b/integrations/nvidia/src/haystack_integrations/components/generators/nvidia/generator.py @@ -15,11 +15,12 @@ class NvidiaGenerator: """ A component for generating text using generative models provided by - [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/). + [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) + and NVIDIA Inference Microservices. Usage example: ```python - from haystack_integrations.components.generators.nvidia import NvidiaGenerator, NvidiaGeneratorModel + from haystack_integrations.components.generators.nvidia import NvidiaGenerator generator = NvidiaGenerator( model="nv_llama2_rlhf_70b", @@ -55,7 +56,7 @@ def __init__( :param api_key: API key for the NVIDIA AI Foundation Endpoints. :param api_url: - Custom API URL for the NVIDIA NeMo Inference Microservices. + Custom API URL for the NVIDIA Inference Microservices. :param model_arguments: Additional arguments to pass to the model provider. Different models accept different arguments. Search your model in the [Nvidia catalog](https://catalog.ngc.nvidia.com/ai-foundation-models)