openai-cookbook
openai-cookbook copied to clipboard
Error pickle saving embeddings
trafficstars
Hi there, I tried to save embeddings following the approach from this notebook: openai-cookbook/examples/Recommendation_using_embeddings.ipynb
Error: return pickle.load(handles.handle) EOFError: Ran out of input
Here is the code:
set path to embedding cache
embedding_cache_path = "data/my_embeddings_cache.pkl"
load the cache if it exists, and save a copy to disk
try: embedding_cache = pd.read_pickle(embedding_cache_path) except FileNotFoundError: embedding_cache = {} with open(embedding_cache_path, "wb") as embedding_cache_file: pickle.dump(embedding_cache, embedding_cache_file)