Update python_server/server.py
This commit is contained in:
@@ -95,8 +95,8 @@ def similarity_search(embedding, top_k=1, threshold=0.7):
|
||||
return {"status": False, "SKU": None}
|
||||
best = points[0]
|
||||
if best.score >= threshold:
|
||||
print({"status": True, "SKU": best.payload.get("sku")}, "threshold:", best.score)
|
||||
return {"status": True, "SKU": best.payload.get("sku")}
|
||||
print({"status": True, "SKU": best.payload.get("product_id")}, "threshold:", best.score)
|
||||
return {"status": True, "SKU": best.payload.get("product_id")}
|
||||
print({"status": False, "SKU": None}, "threshold:", best.score)
|
||||
return {"status": False, "SKU": None}
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user