itsayushpandey commented on code in PR #32018:
URL: https://github.com/apache/beam/pull/32018#discussion_r1769467465
##########
examples/notebooks/beam-ml/rag_usecase/opensearch_rag_pipeline.ipynb:
##########
@@ -0,0 +1,1681 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "aab0b3c8-f952-4db8-8026-74d4d0d18f2c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# @title ###### Licensed to the Apache Software Foundation (ASF), Version
2.0 (the \"License\")\n",
+ "\n",
+ "# Licensed to the Apache Software Foundation (ASF) under one\n",
+ "# or more contributor license agreements. See the NOTICE file\n",
+ "# distributed with this work for additional information\n",
+ "# regarding copyright ownership. The ASF licenses this file\n",
+ "# to you under the Apache License, Version 2.0 (the\n",
+ "# \"License\"); you may not use this file except in compliance\n",
+ "# with the License. You may obtain a copy of the License at\n",
+ "#\n",
+ "# http://www.apache.org/licenses/LICENSE-2.0\n",
+ "#\n",
+ "# Unless required by applicable law or agreed to in writing,\n",
+ "# software distributed under the License is distributed on an\n",
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ "# KIND, either express or implied. See the License for the\n",
+ "# specific language governing permissions and limitations\n",
+ "# under the License"
+ ]
+ },
+ {
Review Comment:
That make sense. I have added an introduction in the notebook.
##########
examples/notebooks/beam-ml/rag_usecase/opensearch_rag_pipeline.ipynb:
##########
@@ -0,0 +1,1681 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "aab0b3c8-f952-4db8-8026-74d4d0d18f2c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# @title ###### Licensed to the Apache Software Foundation (ASF), Version
2.0 (the \"License\")\n",
+ "\n",
+ "# Licensed to the Apache Software Foundation (ASF) under one\n",
+ "# or more contributor license agreements. See the NOTICE file\n",
+ "# distributed with this work for additional information\n",
+ "# regarding copyright ownership. The ASF licenses this file\n",
+ "# to you under the Apache License, Version 2.0 (the\n",
+ "# \"License\"); you may not use this file except in compliance\n",
+ "# with the License. You may obtain a copy of the License at\n",
+ "#\n",
+ "# http://www.apache.org/licenses/LICENSE-2.0\n",
+ "#\n",
+ "# Unless required by applicable law or agreed to in writing,\n",
+ "# software distributed under the License is distributed on an\n",
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ "# KIND, either express or implied. See the License for the\n",
+ "# specific language governing permissions and limitations\n",
+ "# under the License"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "a5097361-e9ca-4217-8b41-55b11178fabf",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "#installing dependencies\n",
+ "!pip install pandas==1.4.4\n",
+ "!pip install numpy==1.24.4\n",
+ "!pip install apache_beam==2.56.0\n",
+ "!pip install opensearch==2.1.0\n",
+ "#used for chunking\n",
+ "!pip install langchain==0.1.14 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "697ad0fa-7625-4a27-b1b7-72eda94748a2",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import apache_beam as beam\n",
+ "import pandas as pd\n",
+ "from apache_beam.ml.transforms.base import MLTransform\n",
+ "from apache_beam.transforms.enrichment import Enrichment\n",
+ "from apache_beam.ml.transforms.embeddings.huggingface import
SentenceTransformerEmbeddings\n",
+ "import tempfile\n",
+ "import json\n",
+ "\n",
+ "from opensearchpy import OpenSearch\n",
+ "from opensearch_connector import *\n",
+ "from opensearch_enrichment import *\n",
+ "from chunks_generation import *"
Review Comment:
Good point. I have added a header and have put the python imports in a
separate cell for better readability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]