Find answers from the community

Updated last month

reranker = TEIR(top_n=10,model_name='BAAI/bge-reranker-large',base_url="http://10.10.10.50

At a glance
@kapa.ai reranker = TEIR(top_n=10,model_name='BAAI/bge-reranker-large',base_url="http://10.10.10.50:8020")

2025-02-06 15:03:35.107 | ERROR | core.inference_retriver:query_index:338 - Error in query_index UUID: None token: None - 1 validation error for TextEmbeddingInference
top_n
Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='BAAI/bge-reranker-large', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/int_parsing
k
2 comments
Please stand by @Bhavya Giri as I search the knowledge base. I normally take about 15 seconds or so. :wave:
----------------------
Based on the error message you've provided, it appears there's a misunderstanding in how the TEIR (TextEmbeddingInference) reranker is being initialized. The error suggests that the model_name parameter is being incorrectly assigned to the top_n parameter. Let me explain the correct usage based on the information from the knowledge sources:

The correct way to initialize the TextEmbeddingInference reranker should be:

Plain Text
reranker = TextEmbeddingInference(
    top_n=10,
    model_name="BAAI/bge-reranker-large",
    base_url="<http://10.10.10.50:8020">
)


Here's the breakdown of the parameters:

  1. top_n: This should be an integer, which you've correctly set to 10.
  2. model_name: This is a string parameter, which you've correctly set to 'BAAI/bge-reranker-large'.
  3. base_url: This is the URL for the text embeddings service, which you've set to "
The error occurs because the model_name is being interpreted as the top_n parameter, which expects an integer.

To fix this, make sure you're using the correct class name TextEmbeddingInference instead of TEIR, and ensure that the parameters are in the correct order or explicitly named.

For more details on the correct usage of the TextEmbeddingInference reranker, you can refer to the LlamaIndex API reference for TextEmbeddingInference.

If you're specifically trying to use a different reranker, please make sure you're using the correct class and parameters for that particular reranker implementation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord