waseoke commited on
Commit
e207ade
·
verified ·
1 Parent(s): a0391c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -145,6 +145,10 @@ def recommend_products_for_user(user_id, top_n=1):
145
  elif product_embeddings.ndim == 1: # 1D 배열인 경우 2D로 변환
146
  product_embeddings = product_embeddings.reshape(1, -1)
147
 
 
 
 
 
148
  # Cosine Similarity 계산
149
  similarities = cosine_similarity(user_embedding, product_embeddings).flatten()
150
 
 
145
  elif product_embeddings.ndim == 1: # 1D 배열인 경우 2D로 변환
146
  product_embeddings = product_embeddings.reshape(1, -1)
147
 
148
+ # Debugging: 두 배열의 차원 출력
149
+ print(f"user_embedding shape: {user_embedding.shape}")
150
+ print(f"product_embeddings shape: {product_embeddings.shape}")
151
+
152
  # Cosine Similarity 계산
153
  similarities = cosine_similarity(user_embedding, product_embeddings).flatten()
154