Skip to content

Commit 54ac6bc

Browse files
committed
cleanups
Signed-off-by: Rishi Chandra <[email protected]>
1 parent 13ff674 commit 54ac6bc

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

examples/ML+DL-Examples/Spark-DL/dl_inference/huggingface/deepseek-r1_torch.ipynb

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"source": [
77
"<img src=\"http://developer.download.nvidia.com/notebooks/dlsw-notebooks/tensorrt_torchtrt_efficientnet/nvidia_logo.png\" width=\"90px\">\n",
88
"\n",
9-
"# PySpark LLM Inference: DeepSeek-R1\n",
9+
"# PySpark LLM Inference: DeepSeek-R1 Reasoning Q/A\n",
1010
"\n",
1111
"In this notebook, we demonstrate distributed batch inference with [DeepSeek-R1](https://github.com/deepseek-ai/DeepSeek-R1), using open weights on Huggingface.\n",
1212
"\n",
13-
"We use [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B) as demonstration. DeepSeek's distilled models are based on open-source LLMs (such as Llama/Qwen), and are fine-tuned using samples generated by DeepSeek-R1 to perform multi-step reasoning tasks.\n",
13+
"We use [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B) as demonstration. DeepSeek's distilled models are based on open-source LLMs (such as Llama/Qwen), and are fine-tuned using samples generated by DeepSeek-R1. We'll show how to use the model to reason through word problems.\n",
1414
"\n",
1515
"**Note:** Running this model on GPU with 16-bit precision requires **~18GB** of GPU RAM. Make sure your instances have sufficient GPU capacity."
1616
]
@@ -261,6 +261,7 @@
261261
"outputs": [],
262262
"source": [
263263
"import os\n",
264+
"import pandas as pd\n",
264265
"import datasets\n",
265266
"from datasets import load_dataset\n",
266267
"datasets.disable_progress_bars()"
@@ -330,7 +331,7 @@
330331
"source": [
331332
"#### Load DataFrame\n",
332333
"\n",
333-
"Load the Orca Math Word Problems dataset from Huggingface and store in a Spark Dataframe."
334+
"Load the first 500 samples of the [Orca Math Word Problems dataset](https://huggingface.co/datasets/microsoft/orca-math-word-problems-200k) from Huggingface and store in a Spark Dataframe."
334335
]
335336
},
336337
{
@@ -339,8 +340,8 @@
339340
"metadata": {},
340341
"outputs": [],
341342
"source": [
342-
"dataset = load_dataset(\"microsoft/orca-math-word-problems-200k\", split=\"train[:1%]\")\n",
343-
"dataset = dataset.to_pandas()[\"question\"]"
343+
"dataset = load_dataset(\"microsoft/orca-math-word-problems-200k\", split=\"train\", streaming=True)\n",
344+
"dataset = pd.Series([sample[\"question\"] for sample in dataset.take(500)])"
344345
]
345346
},
346347
{

examples/ML+DL-Examples/Spark-DL/dl_inference/huggingface/gemma-7b_torch.ipynb

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"source": [
77
"<img src=\"http://developer.download.nvidia.com/notebooks/dlsw-notebooks/tensorrt_torchtrt_efficientnet/nvidia_logo.png\" width=\"90px\">\n",
88
"\n",
9-
"# PySpark LLM Inference: Gemma-7b\n",
9+
"# PySpark LLM Inference: Gemma-7b Code Comprehension\n",
1010
"\n",
1111
"In this notebook, we demonstrate distributed inference with the Google [Gemma-7b-instruct](https://huggingface.co/google/gemma-7b-it) LLM, using open-weights on Huggingface.\n",
1212
"\n",
13-
"The Gemma-7b-instruct is an instruction-fine-tuned version of the Gemma-7b base model.\n",
13+
"The Gemma-7b-instruct is an instruction-fine-tuned version of the Gemma-7b base model. We'll show how to use the model to perform code comprehension tasks.\n",
1414
"\n",
1515
"**Note:** Running this model on GPU with 16-bit precision requires **~18 GB** of GPU RAM. Make sure your instances have sufficient GPU capacity."
1616
]
@@ -200,6 +200,7 @@
200200
"outputs": [],
201201
"source": [
202202
"import os\n",
203+
"import pandas as pd\n",
203204
"import datasets\n",
204205
"from datasets import load_dataset\n",
205206
"datasets.disable_progress_bars()"
@@ -269,7 +270,7 @@
269270
"source": [
270271
"#### Load DataFrame\n",
271272
"\n",
272-
"Load the code comprehension dataset from Huggingface and store in a Spark Dataframe."
273+
"Load the first 500 samples of the [Code Comprehension dataset](https://huggingface.co/datasets/imbue/code-comprehension) from Huggingface and store in a Spark Dataframe."
273274
]
274275
},
275276
{
@@ -278,8 +279,8 @@
278279
"metadata": {},
279280
"outputs": [],
280281
"source": [
281-
"dataset = load_dataset(\"imbue/code-comprehension\", split=\"train[:1%]\")\n",
282-
"dataset = dataset.to_pandas()[\"question\"]"
282+
"dataset = load_dataset(\"imbue/code-comprehension\", split=\"train\", streaming=True)\n",
283+
"dataset = pd.Series([sample[\"question\"] for sample in dataset.take(500)])"
283284
]
284285
},
285286
{
Loading

0 commit comments

Comments
 (0)