Skip to content

Commit

Permalink
remove initial query
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Dec 7, 2023
1 parent 94b85d2 commit f8e64f3
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,38 @@
print("Chroma is not available")

# pre-populate chroma with all creations which already have embeddings
pipeline2 = [
{
"$match": {
"embedding": {"$exists": True},
"embedding.embedding": {"$exists": True},
"embedding.score": {"$exists": True}
}
}
]

pipeline = [
{
"$match": {
"user": {"$exists": True}
}
},
{
"$limit": 50
}
]

print("e7")
documents = creations.aggregate(pipeline)
print("e9")
for document in documents:
print(document)
# collection.upsert(
# embeddings=[document['embedding']['embedding']],
# metadatas=[{"user": str(document['user'])}],
# ids=[str(document['_id'])]
# )
print("e8")
# pipeline2 = [
# {
# "$match": {
# "embedding": {"$exists": True},
# "embedding.embedding": {"$exists": True},
# "embedding.score": {"$exists": True}
# }
# }
# ]

# pipeline = [
# {
# "$match": {
# "user": {"$exists": True}
# }
# },
# {
# "$limit": 50
# }
# ]

# print("e7")
# documents = creations.aggregate(pipeline)
# print("e9")
# for document in documents:
# print(document)
# # collection.upsert(
# # embeddings=[document['embedding']['embedding']],
# # metadatas=[{"user": str(document['user'])}],
# # ids=[str(document['_id'])]
# # )
# print("e8")

# print(f"Chroma now has {collection.count()} creations")

Expand Down Expand Up @@ -140,7 +140,7 @@ def induct_creation(document):

def scan_unembedded_creations():
query = {
"thumbnail": {"$regex": r"\.webp$"}, # Filter for documents where "thumbnail" ends with ".webm"
"thumbnail": {"$regex": r"\.webp$"}, # Filter for documents where "thumbnail" ends with ".webp"
}
sort_order = [("insertion_timestamp", pymongo.DESCENDING)] # Assuming there's an "insertion_timestamp" field

Expand Down

0 comments on commit f8e64f3

Please sign in to comment.