Skip to content

Commit

Permalink
Update fine tuning ptl notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
ash0ts committed Dec 4, 2023
1 parent 3710a1e commit c63bb1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"outputs": [],
"source": [
"# Install some dependencies\n",
"!pip install pandas torch pytorch-lightning transformers==4.1.1 -q\n",
"!pip install pandas torch lightning transformers\n",
"!pip install -Uq wandb"
]
},
Expand All @@ -81,7 +81,7 @@
"import transformers\n",
"import numpy as np\n",
"import pandas as pd\n",
"import pytorch_lightning as pl"
"import lightning.pytorch as pl"
]
},
{
Expand Down Expand Up @@ -426,7 +426,7 @@
" gpus = -1 if torch.cuda.is_available() else 0\n",
" \n",
" # Construct a Trainer object with the W&B logger we created and epoch set by the config object\n",
" trainer = pl.Trainer(max_epochs=config.epochs, gpus=gpus, logger=logger)\n",
" trainer = pl.Trainer(max_epochs=config.epochs, logger=logger)\n",
" \n",
" # Build data loaders for our datasets, using the batch_size from our config object\n",
" train_data_loader = torch.utils.data.DataLoader(train_dataset, batch_size=config.batch_size)\n",
Expand Down Expand Up @@ -536,6 +536,18 @@
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install lightning -q\n",
"!pip install lightning torchvision -q\n",
"# install weights and biases\n",
"!pip install wandb -qU"
]
Expand Down Expand Up @@ -452,6 +452,18 @@
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c63bb1b

Please sign in to comment.