AnswerDotAI / rerankers

A lightweight, low-dependency, unified API to use all common reranking and cross-encoder models.
Apache License 2.0
784 stars 40 forks source link

Add possibility of changing the input template on T5Ranker #17

Closed marcospiau closed 3 months ago

marcospiau commented 3 months ago

Hi guys,

Thanks for your great work!

I'll soon release some MonoT5 rerankers for Portuguese, and I'm heavily considering recommending the rerankers package as the default way of using it, instead of using more complex libraries or writing code from scratch. However, because I used a different template for formatting inputs, I cannot directly use the rerankers package.

I already created a PR (https://github.com/AnswerDotAI/rerankers/pull/16) introducing the required changes. While doing so, I noted that the _get_output_tokens function does not set the token_false to the default value for unknown models, so I included this fix as well.

Can you guys please take a look at my PR?

Thanks!

bclavie commented 3 months ago

Hey, I've just merged the PR, thank you 😊 I'll release it on PyPi later today along with some other tweaks!

Looking forward to the models 👀

marcospiau commented 3 months ago

Thanks, @bclavie !