Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trl version to 0.2.12 and add Python venv instructions #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions examples/language-modeling/gemma_tuning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,39 @@
" -- -L 8888:localhost:8888"
]
},
{
"cell_type": "markdown",
"id": "ba1788d9",
"metadata": {},
"source": [
"Once we have access to the TPU VM, we can setup a virtual Python environment to install our packages in:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be an optional step. Could you rename it into something like: "While not strictly necessary, you can do an extra step to isolate your python environment by installing python-venv:" (or something like this).

]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0e686d24",
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"# Install the venv package for Python 3.10(adapt for your version)\n",
"sudo apt-get install python3.10-venv\n",
"# Create the virtual environment\n",
"python -m venv optimum-tpu-env\n",
"# Activate the virtual environment\n",
"source optimum-tpu-env/bin/activate"
]
},
{
"cell_type": "markdown",
"id": "79fda238",
"metadata": {},
"source": [
"Once we have access to the TPU VM, we can clone the `optimum-tpu` repository containing the related notebook. Then we can install few packages used in this tutorial and launch the notebook:"
"Next, we can clone the `optimum-tpu` repository containing the related notebook. Then we can install few packages used in this tutorial and launch the notebook:"
]
},
{
Expand All @@ -65,7 +92,7 @@
"# Install Optimum tpu\n",
"pip install -e . -f https://storage.googleapis.com/libtpu-releases/index.html\n",
"# Install TRL and PEFT for training (see later how they are used)\n",
"pip install trl peft\n",
"pip install trl==0.2.12 peft\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the problem with trl 0.2.13? Can you open an issue describing the issue you observed so that we can fix it in the future?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the same issue as @duncantech. Trl 0.2.13 as some breaking changes and so the interface is different. We need to adapt the examples to make them work with the latest version. I think this could be done in another PR tho

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baptistecolle can you open an issue to do that later?

"# Install Jupyter notebook\n",
"pip install -U jupyterlab notebook\n",
"# Optionally, install widgets extensions for better rendering\n",
Expand Down