openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

small change to move every api call inside while loop

Open ancri opened this issue 1 year ago • 1 comments

Currently there's an openai.Embedding.create call outside the while loop, and then the call is replicated inside of the exception-handling loop. This seems superfluous, so simplifying it slightly.

ancri avatar May 19 '23 17:05 ancri

@jamescalam, look good to you?

ted-at-openai avatar May 23 '23 17:05 ted-at-openai

Looking more closely, this doesn't look right. It deletes the while loop. Now the done variable is never used and some embeddings may never be calculated. Let me know if I've misunderstood. Otherwise, I'll close.

ted-at-openai avatar Jun 24 '23 00:06 ted-at-openai

Thanks, you're right, apologies. Opened another PR where this is fixed.

ancri avatar Jun 24 '23 04:06 ancri