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

Maintain score order when curating sources #1643

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

Hoffelhas
Copy link
Contributor

I noticed that every time after restarting PrivateGPT, the output on the screen would vary with similar queries used in "Search Files" mode even though the retrieved 'response' contained the same values that were ordered to the same scores.

After some troubleshooting, it looked like the output from the Source.curate_sources(response) function mixes up the values, which results in sources that are no longer ordered to the reponse scores.

In order to fix this, 'curated_sources' in the 'Source' class is changed from a set to a unique list to ensure that the score order is maintained and the results are consistent.

Changed 'curated_sources' from a list, in order to maintain score order when returning the curated sources.
@Hoffelhas Hoffelhas changed the title Update ui.py Maintain score order when curating sources Feb 23, 2024
@imartinez
Copy link
Collaborator

@Hoffelhas please run make check locally. It will fix format issues and check for typing errors.

@Hoffelhas
Copy link
Contributor Author

@Hoffelhas please run make check locally. It will fix format issues and check for typing errors.

Done 👍

Update x handle to zylon private gpt (zylon-ai#1644)
@imartinez imartinez merged commit 410bf7a into zylon-ai:main Mar 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants