Skip to content

Commit

Permalink
seeding cell got removed, re-adding it
Browse files Browse the repository at this point in the history
Signed-off-by: kta-intel <[email protected]>
  • Loading branch information
kta-intel committed Mar 1, 2024
1 parent 73f6416 commit 2974641
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,34 @@
"from datasets import DatasetDict"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c9aa89c7-76f7-49a1-a50b-b4a8cabe22d3",
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"import numpy as np\n",
"import torch\n",
"\n",
"# Set a seed value\n",
"seed = 42 \n",
"\n",
"# Python's random module\n",
"random.seed(seed)\n",
"\n",
"# Numpy\n",
"np.random.seed(seed)\n",
"\n",
"# PyTorch\n",
"torch.manual_seed(seed)\n",
"\n",
"# Transformers\n",
"from transformers import set_seed\n",
"set_seed(seed)"
]
},
{
"cell_type": "markdown",
"id": "c9c16b3f-963e-4531-94a5-258d7f61fe08",
Expand Down

0 comments on commit 2974641

Please sign in to comment.