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

QA using Embeddings: Issues running code

Open yannickauff opened this issue 1 year ago • 1 comments

I've tried running the "Question Answering using Embeddings" code.

But in the embedding section (starting at def get_embedding) I run into an error that I haven't been able to fix: TypeError: 'type' object is not subscriptable.

Any suggestions on how to solve this issue?

yannickauff avatar Feb 27 '23 11:02 yannickauff

Option 1: Use a newer version of Python (3.9+).

Option 2: Delete the type hints in the function definitions.

The error is coming from the type hints; e.g., "-> List[int]".

ted-at-openai avatar Feb 27 '23 17:02 ted-at-openai