1

So, I'm running code for text embedder, using Openai Ada-002 model. Code looks something like that:

import pandas as pd
from openai.embeddings_utils import get_embedding, cosine_similarity
import openai
import os

openai.api_key = os.environ.get('API_KEY')
embedding_model = "text-embedding-ada-002"

csvfiles = os.listdir(csvpath)
for filename in csvfiles:
    if filename.endswith('.csv'):
        embfilename = embedpath + '\\' + filename
        df = pd.read_csv(csvpath + '\\' + filename)
        df['embeddings'] = df['names'].apply(lambda x: get_embedding(x, embedding_model))
        newfilename = embedpath + '\\' + 'embs_' + filename
        df.to_csv(newfilename)

I'm getting this error:

RetryError: RetryError[<Future at 0x1eeae8e77f0 state=finished raised AttributeError>]

I tried changing API Key as someone was suggesting on GitHub but it didn't work.

Any ideas how I can debug this?

1
  • My issue was with the expired free trial. They've updated the terms, and now you need to add a payment method to use the API, whereas before, they used to offer an $18 free trial. Commented Sep 15, 2023 at 8:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.