LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

fix(reranker): support omitting top_n

Open mkhludnev opened this issue 1 month ago • 1 comments

Description

This PR fixes the issue introduced in #7025

Notes for Reviewers

#7025 introduced handling result cropping by top_n. However, I believe the most users just omit top_n, just because don't bother to count len(documents). So, I'm afraid releasing #7025 causes a trouble for many users. @mudler, beg your pardon. This PR let users to omit top_n or send top_n=0 meaning all docs.

One thing about tests, since tey bring up the backend every time, isn't it worth to loop three alt requests in the single test method?

Signed commits

  • [v] Yes, I signed my commits.

mkhludnev avatar Nov 08 '25 18:11 mkhludnev

Deploy Preview for localai ready!

Name Link
Latest commit eec1f59ce759eee2913824d98176a6f69b212ded
Latest deploy log https://app.netlify.com/projects/localai/deploys/6910b05b2fe2450008889c8d
Deploy Preview https://deploy-preview-7199--localai.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Nov 08 '25 18:11 netlify[bot]

#7025 introduced handling result cropping by top_n. However, I believe the most users just omit top_n, just because don't bother to count len(documents). So, I'm afraid releasing #7025 causes a trouble for many users. @mudler, beg your pardon. This PR let users to omit top_n or send top_n=0 meaning all docs.

One thing about tests, since tey bring up the backend every time, isn't it worth to loop three alt requests in the single test method?

Yes, that would make def. sense!

mudler avatar Nov 09 '25 17:11 mudler

asserts #7284

mkhludnev avatar Nov 16 '25 14:11 mkhludnev