|
6 | 6 | "source": [
|
7 | 7 | "<img src=\"http://developer.download.nvidia.com/notebooks/dlsw-notebooks/tensorrt_torchtrt_efficientnet/nvidia_logo.png\" width=\"90px\">\n",
|
8 | 8 | "\n",
|
9 |
| - "# PySpark LLM Inference: DeepSeek-R1\n", |
| 9 | + "# PySpark LLM Inference: DeepSeek-R1 Reasoning Q/A\n", |
10 | 10 | "\n",
|
11 | 11 | "In this notebook, we demonstrate distributed batch inference with [DeepSeek-R1](https://github.com/deepseek-ai/DeepSeek-R1), using open weights on Huggingface.\n",
|
12 | 12 | "\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", |
14 | 14 | "\n",
|
15 | 15 | "**Note:** Running this model on GPU with 16-bit precision requires **~18GB** of GPU RAM. Make sure your instances have sufficient GPU capacity."
|
16 | 16 | ]
|
|
261 | 261 | "outputs": [],
|
262 | 262 | "source": [
|
263 | 263 | "import os\n",
|
| 264 | + "import pandas as pd\n", |
264 | 265 | "import datasets\n",
|
265 | 266 | "from datasets import load_dataset\n",
|
266 | 267 | "datasets.disable_progress_bars()"
|
|
330 | 331 | "source": [
|
331 | 332 | "#### Load DataFrame\n",
|
332 | 333 | "\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." |
334 | 335 | ]
|
335 | 336 | },
|
336 | 337 | {
|
|
339 | 340 | "metadata": {},
|
340 | 341 | "outputs": [],
|
341 | 342 | "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)])" |
344 | 345 | ]
|
345 | 346 | },
|
346 | 347 | {
|
|
0 commit comments