Can't run quenstion-answer LLM finetuning demo in google colab

I am trying to get familiar with the fine-tuning example from the link below. I clicked open in colab with pytorch.

However, when executing the training argument line, I received the ImportError as below. I tried pip install

I didn’t do any additional coding.

Please let me know if you have any idea to solve this issue. Thank you very much.

This is a problem I faced while doing many other demo notebooks as well.
So the solution I found is to run this at the very start of your notebook:

!pip install transformers[torch]
!pip install accelerate -U
import os

Then when the runtime restarts delete this cell and run the code again. Atleast, this error should go away.

1 Like

Thank you so much. This helps me resolve the problem.

1 Like