Skip to content

Commit 898ae7f

Browse files
authored
Fix missplace for vector sim weight and token sim weight. (#4627)
### What problem does this PR solve? #4610 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent fa42772 commit 898ae7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: api/apps/sdk/chat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def create(tenant_id):
140140
res["prompt"] = renamed_dict
141141
del res["prompt_config"]
142142
new_dict = {"similarity_threshold": res["similarity_threshold"],
143-
"keywords_similarity_weight": res["vector_similarity_weight"],
143+
"keywords_similarity_weight": 1-res["vector_similarity_weight"],
144144
"top_n": res["top_n"],
145145
"rerank_model": res['rerank_id']}
146146
res["prompt"].update(new_dict)
@@ -304,7 +304,7 @@ def list_chat(tenant_id):
304304
res["prompt"] = renamed_dict
305305
del res["prompt_config"]
306306
new_dict = {"similarity_threshold": res["similarity_threshold"],
307-
"keywords_similarity_weight": res["vector_similarity_weight"],
307+
"keywords_similarity_weight": 1-res["vector_similarity_weight"],
308308
"top_n": res["top_n"],
309309
"rerank_model": res['rerank_id']}
310310
res["prompt"].update(new_dict)

0 commit comments

Comments
 (0)