rszper commented on code in PR #27075:
URL: https://github.com/apache/beam/pull/27075#discussion_r1224670793
##########
examples/notebooks/beam-ml/run_inference_generative_AI.ipynb:
##########
@@ -40,20 +40,20 @@
"cellView": "form",
"id": "IVkpU8HZ1eyz"
},
- "execution_count": 74,
+ "execution_count": 1,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
- "# Apache Beam RunInference in a Streaming Pipeline\n",
+ "# Apache Beam RunInference for Generative AI\n",
"\n",
"<table align=\"left\">\n",
" <td>\n",
- " <a target=\"_blank\"
href=\"https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/beam-ml/run_inference_streaming_pipeline.ipynb\"><img
src=\"https://raw.githubusercontent.com/google/or-tools/main/tools/colab_32px.png\"
/>Run in Google Colab</a>\n",
+ " <a target=\"_blank\"
href=\"https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/beam-ml/run_inference_generative_AI.ipynb\"><img
src=\"https://raw.githubusercontent.com/google/or-tools/main/tools/colab_32px.png\"
/>Run in Google Colab</a>\n",
Review Comment:
If possible, all characters in the URL should be lowercase.
##########
examples/notebooks/beam-ml/run_inference_generative_AI.ipynb:
##########
@@ -190,13 +163,14 @@
"metadata": {
"id": "PKhkiQFJe44n"
},
- "execution_count": 76,
+ "execution_count": 4,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
- "### Utitlity functions for before/after running RunInference"
+ "## Define utitlity functions\n",
+ "The input and output for the
[`google/flan-t5-small`](https://huggingface.co/google/flan-t5-small) model are
token tensors. These utility functions are used for the conversion of text to
token tensors and back.\n"
Review Comment:
```suggestion
"The input and output for the
[`google/flan-t5-small`](https://huggingface.co/google/flan-t5-small) model are
token tensors. These utility functions are used for the conversion of text to
token tensors and then back to text.\n"
```
##########
examples/notebooks/beam-ml/run_inference_generative_AI.ipynb:
##########
@@ -40,20 +40,20 @@
"cellView": "form",
"id": "IVkpU8HZ1eyz"
},
- "execution_count": 74,
+ "execution_count": 1,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
- "# Apache Beam RunInference in a Streaming Pipeline\n",
+ "# Apache Beam RunInference for Generative AI\n",
Review Comment:
```suggestion
"# Use RunInference for Generative AI\n",
```
##########
examples/notebooks/beam-ml/run_inference_generative_AI.ipynb:
##########
@@ -97,39 +97,14 @@
"source": [
"!pip install apache_beam[gcp]==2.48.0\n",
"!pip install torch\n",
- "!pip install transformers\n",
- "!pip install tensorflow"
+ "!pip install transformers"
]
},
{
"cell_type": "markdown",
"source": [
- "### Authenticate with Google Cloud\n",
- "This notebook relies on Google Cloud Pub/Sub as an input to the
pipeline as well for writing out the results. To use your Google Cloud account,
authenticate this notebook."
- ],
- "metadata": {
- "id": "A0v-oGSfsTHh"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "from google.colab import auth\n",
- "auth.authenticate_user()"
- ],
- "metadata": {
- "id": "hNslPJGil2Zc"
- },
- "execution_count": 63,
- "outputs": []
- },
- {
- "cell_type": "markdown",
- "source": [
- "### Import dependencies and set up your bucket\n",
- "Use the following code to import dependencies and to set up your
Google Cloud Storage bucket.\n",
- "\n",
- "Replace `MESSAGE_TOPIC` and `RESPONSE_TOPIC` with the Pub/Sub topics
in your project.\n",
+ "## Import dependencies\n",
+ "Use the following code to import dependencies\n",
Review Comment:
```suggestion
"Use the following code to import dependencies.\n",
```
How are these dependencies different from the dependencies in the previous
section?
##########
examples/notebooks/beam-ml/run_inference_generative_AI.ipynb:
##########
@@ -64,12 +64,11 @@
{
"cell_type": "markdown",
"source": [
- "This notebook shows how to use the Apache Beam
[RunInference](https://beam.apache.org/releases/pydoc/current/apache_beam.ml.inference.base.html#apache_beam.ml.inference.base.RunInference)
transform in a streaming pipeline with [Google Cloud
Pub-Sub](https://cloud.google.com/pubsub?utm_source=google&utm_medium=cpc&utm_campaign=na-US-all-en-dr-bkws-all-all-trial-b-dr-1605212&utm_content=text-ad-none-any-DEV_c-CRE_648329165516-ADGP_Desk%20%7C%20BKWS%20-%20BRO%20%7C%20Txt%20_%20Pub%2Fsub-KWID_43700075187144857-aud-664745643345%3Akwd-874320293016&utm_term=KW_pub%20sub%20google%20cloud-ST_pub%20sub%20google%20cloud&gclid=CjwKCAjw-IWkBhBTEiwA2exyO19xMFn6h1UKjb4QUavatV8Yb5Au9pCQj2_VAo0rzaYS8v2bq5VmuBoCL9wQAvD_BwE&gclsrc=aw.ds).\n",
+ "This notebook shows how to use the Apache Beam
[RunInference](https://beam.apache.org/releases/pydoc/current/apache_beam.ml.inference.base.html#apache_beam.ml.inference.base.RunInference)
transform for generative AI task using large language model(LLM) from [Hugging
Face Models](https://huggingface.co/models) hub.\n",
Review Comment:
```suggestion
"This notebook shows how to use the Apache Beam
[RunInference](https://beam.apache.org/releases/pydoc/current/apache_beam.ml.inference.base.html#apache_beam.ml.inference.base.RunInference)
transform for generative AI tasks. It uses a large language model (LLM) from
the [Hugging Face Model Hub](https://huggingface.co/models).\n",
```
--
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]