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

Conversation

shaohuzhang1
Copy link
Contributor

fix: bai_lian rerank default model

Copy link

f2c-ci-robot bot commented Jan 22, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Jan 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -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.

@shaohuzhang1 shaohuzhang1 merged commit 21d505a into main Jan 22, 2025
4 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@main@fix_bailian_default_model branch January 22, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant