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

Q/A Embeddings Function constantly fails

Open capri-ai-us opened this issue 1 year ago • 4 comments

I am fairly new to Python, but trying to follow along with the Colab notebook exactly, and for some reason no matter what I try, I continuously get the following error :

----> 1 def load_embeddings(fname: str) -> dict[tuple[str, str], list[float]]: 2 """ 3 Read the document embeddings and their keys from a CSV. 4 5 fname is the path to a CSV with exactly these named columns:

TypeError: 'type' object is not subscriptable

For reference, this is from cell number 7 and 8 from this notebook: Screenshot 2023-02-01 at 1 53 02 PM

https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb

Any help is greatly appreciated, I've solved for the embeddings at this point and just want to try and calculate nearest K from the results, but it just won't even seem to initialize the function

capri-ai-us avatar Feb 01 '23 18:02 capri-ai-us