Find answers from the community

Updated 2 months ago

❓issues and help


Statement: I am trying to build a chatbot that takes a text file as input and answers the queries given. I am able to load the data, but I am getting an error as shown in the screenshots. Can you please help me resolve it?

I have attached the code on GitHub as well. Here is the link:
https://github.com/pvchaitanya8/Workflow/blob/main/test_1%20copy.ipynb

Can you please help me?
Attachments
image.png
Screenshot_2023-07-19_192209.png
L
A
17 comments
notebooks don't seem to pick out the key lately properly

you need to also set it on the openai module for notebooks

Plain Text
import openai
openai.api_key = os.environ["OPENAI_API_KEY"]
Thank you brother for responding!!
I have changed the code but I am getting the same error
Attachments
image.png
image.png
During initial execution I got Runlimiterror. But after running multiple times I am getting the same old error
It looks like your API key is invalid
Plain Text
AuthenticationError: Incorrect API key provided: sk-WRlaD***************************************wHwn. You can find your API key at https://platform.openai.com/account/api-keys.
so it's finding the key, the key is just incorrect 👀 Maybe double check your openai account
Sorry my bad, the key got expired.
I am getting this after giving correct api key, [RateLimitError]
Attachment
image.png
Do you have a paid account? If so, then you may need to lower the batch size from the default of 10 (tbh I would only expect to do this for large datasets)

Plain Text
from llama_index.embeddings.openai import OpenAIEmbedding

emebd_model = OpenAIEmbedding(embed_batch_size=1)

service_context = ServiceContext.from_defaults(emebd_model=embed_model)
If you have free tokens, then the rate limits are very extreme
I don't have paid account
I am using free once
Yea then try lowering the batch size, but tbh the rate limit errors are pretty strict
Thank you so much issue has been resolved 🥳🥳
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord