Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,5 +45,12 @@ product_data = product_collection.find_one({"product_id": "1"}) # 특정 상품
|
|
45 |
if product_data:
|
46 |
product_embedding = embed_product_data(product_data)
|
47 |
print("Product Embedding:", product_embedding)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
else:
|
49 |
print("Product not found.")
|
|
|
45 |
if product_data:
|
46 |
product_embedding = embed_product_data(product_data)
|
47 |
print("Product Embedding:", product_embedding)
|
48 |
+
|
49 |
+
# product_id 기준으로 임베딩을 MongoDB에 저장
|
50 |
+
product_collection.update_one(
|
51 |
+
{"product_id": "1"},
|
52 |
+
{"$set": {"embedding": product_embedding.tolist()}}
|
53 |
+
)
|
54 |
+
print("Embedding saved to MongoDB based on product_id.")
|
55 |
else:
|
56 |
print("Product not found.")
|