Files
langchain/docs/versioned_docs/version-0.2.x/integrations/text_embedding/nemo.ipynb
Jacob Lee aff771923a Jacob/new docs (#20570)
Use docusaurus versioning with a callout, merged master as well

@hwchase17 @baskaryan

---------

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Co-authored-by: Leonid Ganeline <leo.gan.57@gmail.com>
Co-authored-by: Leonid Kuligin <lkuligin@yandex.ru>
Co-authored-by: Averi Kitsch <akitsch@google.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
Co-authored-by: Nuno Campos <nuno@langchain.dev>
Co-authored-by: Nuno Campos <nuno@boringbits.io>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Martín Gotelli Ferenaz <martingotelliferenaz@gmail.com>
Co-authored-by: Fayfox <admin@fayfox.com>
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Co-authored-by: Dawson Bauer <105886620+djbauer2@users.noreply.github.com>
Co-authored-by: Ravindu Somawansa <ravindu.somawansa@gmail.com>
Co-authored-by: Dhruv Chawla <43818888+Dominastorm@users.noreply.github.com>
Co-authored-by: ccurme <chester.curme@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: WeichenXu <weichen.xu@databricks.com>
Co-authored-by: Benito Geordie <89472452+benitoThree@users.noreply.github.com>
Co-authored-by: kartikTAI <129414343+kartikTAI@users.noreply.github.com>
Co-authored-by: Kartik Sarangmath <kartik@thirdai.com>
Co-authored-by: Sevin F. Varoglu <sfvaroglu@octoml.ai>
Co-authored-by: MacanPN <martin.triska@gmail.com>
Co-authored-by: Prashanth Rao <35005448+prrao87@users.noreply.github.com>
Co-authored-by: Hyeongchan Kim <kozistr@gmail.com>
Co-authored-by: sdan <git@sdan.io>
Co-authored-by: Guangdong Liu <liugddx@gmail.com>
Co-authored-by: Rahul Triptahi <rahul.psit.ec@gmail.com>
Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Co-authored-by: pjb157 <84070455+pjb157@users.noreply.github.com>
Co-authored-by: Eun Hye Kim <ehkim1440@gmail.com>
Co-authored-by: kaijietti <43436010+kaijietti@users.noreply.github.com>
Co-authored-by: Pengcheng Liu <pcliu.fd@gmail.com>
Co-authored-by: Tomer Cagan <tomer@tomercagan.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
2024-04-18 11:10:55 -07:00

122 lines
3.1 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "abede47c-6a58-40c3-b7ef-10966a4fc085",
"metadata": {},
"source": [
"# NVIDIA NeMo embeddings"
]
},
{
"cell_type": "markdown",
"id": "38f3d4ce-b36a-48c6-88b0-5970c26bb146",
"metadata": {},
"source": [
"Connect to NVIDIA's embedding service using the `NeMoEmbeddings` class.\n",
"\n",
"The NeMo Retriever Embedding Microservice (NREM) brings the power of state-of-the-art text embedding to your applications, providing unmatched natural language processing and understanding capabilities. Whether you're developing semantic search, Retrieval Augmented Generation (RAG) pipelines—or any application that needs to use text embeddings—NREM has you covered. Built on the NVIDIA software platform incorporating CUDA, TensorRT, and Triton, NREM brings state of the art GPU accelerated Text Embedding model serving.\n",
"\n",
"NREM uses NVIDIA's TensorRT built on top of the Triton Inference Server for optimized inference of text embedding models."
]
},
{
"cell_type": "markdown",
"id": "f5ab6ea1-d074-4f36-ae45-50312a6a82b9",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "32deab16-530d-455c-b40c-914db048cb05",
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.embeddings import NeMoEmbeddings"
]
},
{
"cell_type": "markdown",
"id": "de40023c-3391-474d-96cf-fbfb2311e9d7",
"metadata": {},
"source": [
"## Setup"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "37177018-47f4-48be-8575-83ce5c9a5447",
"metadata": {},
"outputs": [],
"source": [
"batch_size = 16\n",
"model = \"NV-Embed-QA-003\"\n",
"api_endpoint_url = \"http://localhost:8080/v1/embeddings\""
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "08161ed2-8ba3-4226-a387-15c348f8c343",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Checking if endpoint is live: http://localhost:8080/v1/embeddings\n"
]
}
],
"source": [
"embedding_model = NeMoEmbeddings(\n",
" batch_size=batch_size, model=model, api_endpoint_url=api_endpoint_url\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c69070c3-fe2d-4ff7-be4a-73304e2c4f3e",
"metadata": {},
"outputs": [],
"source": [
"embedding_model.embed_query(\"This is a test.\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5d1d8852-5298-40b5-89c4-5a91ccfc95e5",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}