Skip to content

Commit

Permalink
Fix missplace for vector sim weight and token sim weight. (#4627)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

#4610

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Jan 24, 2025
1 parent fa42772 commit 898ae7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/apps/sdk/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def create(tenant_id):
res["prompt"] = renamed_dict
del res["prompt_config"]
new_dict = {"similarity_threshold": res["similarity_threshold"],
"keywords_similarity_weight": res["vector_similarity_weight"],
"keywords_similarity_weight": 1-res["vector_similarity_weight"],
"top_n": res["top_n"],
"rerank_model": res['rerank_id']}
res["prompt"].update(new_dict)
Expand Down Expand Up @@ -304,7 +304,7 @@ def list_chat(tenant_id):
res["prompt"] = renamed_dict
del res["prompt_config"]
new_dict = {"similarity_threshold": res["similarity_threshold"],
"keywords_similarity_weight": res["vector_similarity_weight"],
"keywords_similarity_weight": 1-res["vector_similarity_weight"],
"top_n": res["top_n"],
"rerank_model": res['rerank_id']}
res["prompt"].update(new_dict)
Expand Down

0 comments on commit 898ae7f

Please sign in to comment.