[Question]: LLMReranker #8445
Replies: 3 comments
-
🤖 Hello, Thank you for reaching out. The error message you're encountering, "InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>", is indicating that the 'engine' or 'deployment_id' parameter is not provided when initializing the OpenAI class in the LlamaIndex framework. In your code, you're initializing the Here's how you should initialize the llm_completion = AzureOpenAI(deployment_id="gpt-35-turbo1",
model_name="text-davinci-003") In this case, Also, please note that the from llama_index import LLMPredictor
llm_predictor = LLMPredictor(llm=llm_completion)
reranker = LLMReranker(llm_predictor=llm_predictor, choice_batch_size=5, top_n=3) Then, you can use I hope this helps! If you have any other questions, feel free to ask. Best, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
I am getting an error now: In your reply you used LLMReranker instead of LLMRerank, I assume that was a mistake? |
Beta Was this translation helpful? Give feedback.
-
@ddealwis09 yea the bot was not correct lol Can you try also setting a global service context? Azure is very annoying to work with... from llama_index import set_global_service_context
set_global_service_context(service_context) |
Beta Was this translation helpful? Give feedback.
-
Question Validation
Question
Hello, I am having difficulty getting the LLMReranker setup, below is my code, can I am getting an error when I run the query engine. The error I am getting is "InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>" but the query engine works perfectly if I remove the reranker.
Beta Was this translation helpful? Give feedback.
All reactions