'Invalid Token'?


When I come to the training part of this course (section 5) I am met with an ‘Invalid Token’ error.

Anyone come across this and know how to solve it?

Much appreciated in advance!

hi @Martin_Pollard

Are you trying to running locally?

Hi Elirod,

Yes that’s right. I’m guessing I need to set up an API key or something?

1 Like

Yes right. If you are running locally, you have to use your own API key

1 Like

Hi @Martin_Pollard

Yes. If you are running locally you have to use your own credentials


Ah great. Glad that was the only issue. Thanks very much raj and elirod!


You welcome @Martin_Pollard

You are very welcome @Martin_Pollard . Please feel free to reach out to us any for any additional queries.

1 Like

How do I get the api key ?

hi @gangradeamitesh

Welcome to the community.

I will refer you to the openAi page:


Hello @elirod , Thank you for the article.
But I can see this is for OpenAI secret api key , how can I get secret key for llama models? Got any idea ?

So sorry for this misunderstanding.

Let’s start from the top.

Please, share with me a print of your error on the lab.

Also, maybe you have to follow the model instructions from EleutherAI/pythia-70m · Hugging Face in order to setup the model locally.

One more question: are you already installed all the packages in your envirioment? This is a require step to be able to running the labs locally. Because the course platform has installed on the course envirioment.

Hi elirod. Apologies for the late reply. Been building recently, but am now back into doing some learning today.

For me personally, I was able to complete this course as is, but I’m certain with your last post I should be able to resolve. If I run into any issues, I’ll let you know. Thanks again!

1 Like

Hi @Martin_Pollard

Thanks for reporting me back.

Feel free to reach me out regards this issue.

Best regards