Error in Evaluation Part II

Getting error while running L9 code. I tried in firefox and chrome browser. Here is the error message :

File /usr/local/lib/python3.9/site-packages/openai/api_requestor.py:687, in APIRequestor._interpret_response_line(self, rbody, rcode, rheaders, stream)
    685 stream_error = stream and "error" in resp.data
    686 if stream_error or not 200 <= rcode < 300:
--> 687     raise self.handle_error_response(
    688         rbody, rcode, resp.data, rheaders, stream_error=stream_error
    689     )
    690 return resp

AuthenticationError: Your authentication token is not from a valid issuer.

Also attaching browser console error messages, It might help in debugging the issue.

Hi @Karthik_Ganti,

Did you make any changes in the notebook ?

I tried running it, and everything ran fine on my end. I’m guessing something changed on your end. Are you using a different API key than what is provided in the platform ?

Just in case, this is the first code cell:

import os
import openai
import sys
sys.path.append('../..')
import utils
from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv()) # read local .env file

openai.api_key  = os.environ['OPENAI_API_KEY']

And this is the second code cell:

def get_completion_from_messages(messages, model="gpt-3.5-turbo", temperature=0, max_tokens=500):
    response = openai.ChatCompletion.create(
        model=model,
        messages=messages,
        temperature=temperature, 
        max_tokens=max_tokens, 
    )
    return response.choices[0].message["content"]
1 Like

Yeah it works now. Very strange :slightly_smiling_face:

No i did not change anything. But it works now. Don’t know what exactly was the issue.

When you open the lab again after a while, by then it has “reset”. So I’m guessing something unexpectedly changed, which later got reset. But all is well that ends well! Glad it is working for you now.