openai-cookbook
openai-cookbook copied to clipboard
Q/A Embeddings Function constantly fails
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:
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