Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bai_lian rerank default model #2072

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
.append_default_model_info(model_info_list[2])
.append_default_model_info(model_info_list[3])
.append_default_model_info(model_info_list[4])
.append_default_model_info(model_info_list[0])
.build()
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks mostly correct but could be optimized:

  • Adding models in reverse order can improve performance by reducing the need to iterate over the entire list each time you append a new model.

Here's an updated version of the code with this optimization suggestion:

# Assuming model_info_list is sorted from most recent to oldest

model_info = (
    .append_default_model_info(model_info_list[0])
    .append_default_model_info(model_info_list[1])
    .append_default_model_info(model_info_list[2])
    .append_default_model_info(model_info_list[3])
    .append_default_model_info(model_info_list[4])

    .build()
)

This way, when append_default_model_info is called without specifying which index, it will append items starting from the first position (model_info_list[0]) towards the end, potentially improving execution speed slightly if subsequent appends are added after sorting the list initially.

Expand Down
Loading