Running Llama model in Google colab

Hi,

I’m trying to see a Llama 8B model demo in Google colab.

I just tried to run the following code in the colab prompt.

It ran into several errors.

I tried to fix using !pip install transformers[sentencepiece]
or !pip install --upgrade transformers

but to no avail

Any help will be much appreciated.

NameError Traceback (most recent call last)
in <cell line: 5>()
3 get_ipython().system(‘pip install transformers[sentencepiece]’)
4
----> 5 from transformers import pipeline
6
7 model_id = “meta-llama/Meta-Llama-3.1-8B-Instruct”

4 frames
/usr/local/lib/python3.10/dist-packages/torch/init.py in
762
763 __name, __obj = ‘’, None
→ 764 for __name in dir(C):
765 if __name[0] != '
’ and not __name.endswith(‘Base’):
766 all.append(__name)

NameError: name ‘_C’ is not defined