Does not have access to model `text-embedding-ada-002`'

Sorry to create a new topic, I swear that I’ve tried to look in the forum for answers, but looking on other topics I wasn’t able to solve it by myself.

Im following a tutorial to study more about RAG, my code is below:

import dotenv
from langchain.document_loaders.csv_loader import CSVLoader
from langchain_community.vectorstores import Chroma
from langchain_openai import OpenAIEmbeddings

REVIEWS_CSV_PATH = "data/reviews.csv"
REVIEWS_CHROMA_PATH = "chroma_data"

dotenv.load_dotenv()
loader = CSVLoader(file_path=REVIEWS_CSV_PATH, source_column="review")
reviews = loader.load()

reviews_vector_db = Chroma.from_documents(

    reviews, OpenAIEmbeddings(), persist_directory=REVIEWS_CHROMA_PATH

)

But when I try to run I got an error that I do not have permission to use

Error code: 403 - {'error': {'message': 'Project `proj_----` does not have access to model `text-embedding-ada-002`', 'type': 'invalid_request_error'

I do not think that the problem is with my API key as I have been using it for other things related to generate responses and I tried to explicitly use others models and got the some problem.

Am I missing some configuration?

Did you find a solution as I am struggling with the same error

Sorry for the delay, Sanay! Yes, I found a solution, and it was pretty straightforward: the problem was that I had to flag the text-embedding models. At first, I thought it was an issue with the code because I had some deprecated code before, which led me to overlook the problem. However, it was just a matter of going to my project and flagging the models that I can use with my API key.

This:

5 Likes

I just created a new project and API key for that, and it worked.

1 Like