-
Notifications
You must be signed in to change notification settings - Fork 13.2k
server / ranking : add sorting and management of top_n #16403
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
base: master
Are you sure you want to change the base?
Conversation
I don't think the change is backwards compatible - would it work if the request does not include |
no it won't work if no top_n, I can change it to make it back compatible |
Yes, it should remain backward compatible. |
adding a test case is also required for this type of change |
What king of test case? one bash script in comment to test many cases ? |
all results here is a script to make some test ```script URL=${1:-http://127.0.0.1:8181} curl "$URL/v1/rerank" -H "Content-Type: application/json" \ -d '{ "model": "M", "query": "What is the recipe to make bread ?", "return_text" : true, "texts" : true, "top_n": 6, "documents": [ "voici la recette pour faire du pain, il faut de la farine de l eau et du levain et du sel", "it is a bear", "bread recipe : floor, water, yest, salt", "The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.", "here is the ingedients to bake bread : 500g floor, 350g water, 120g fresh refresh yest, 15g salt", "recipe to make cookies : floor, eggs, water, chocolat", "here is the recipe to make bread : 500g floor, 350g water, 120g fresh refresh yest, 15g salt", "il fait tres beau aujourd hui", "je n ai pas faim, je ne veux pas manger", "je suis a paris" ] }' | jq ```
here is one script to test the reranking
|
You should add a server test: https://github.com/ggml-org/llama.cpp/tree/master/tools/server/tests |
server / ranking : add sorting and management of top_n
exemple output for
top_n = 4
:or