Last active
August 18, 2021 14:32
-
-
Save davidmezzetti/9a4cb4fe9a4c69bbca70f0e9792dfa96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run initial query | |
uid = embeddings.search("feel good story", 1)[0][0] | |
print("Initial: ", data[uid]) | |
# Update data | |
data[0] = "See it: baby panda born" | |
embeddings.upsert([(0, data[0], None)]) | |
uid = embeddings.search("feel good story", 1)[0][0] | |
print("After update: ", data[uid]) | |
# Remove record just added from index | |
embeddings.delete([0]) | |
# Ensure value matches previous value | |
uid = embeddings.search("feel good story", 1)[0][0] | |
print("After delete: ", data[uid]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment