mpaepper / content-chatbot

Build a chatbot or Q&A bot of your website's content
https://www.paepper.com/blog/posts/build-q-and-a-bot-of-your-website-using-langchain/
522 stars 56 forks source link

RateLimitError #6

Closed GeiserX closed 1 year ago

GeiserX commented 1 year ago

I was testing the create_embeddings.py file with the default values and it got stuck. It was the first ever time I was testing OpenAI API on my account.

# python3 create_embeddings.py
Split https://www.paepper.com/blog/posts/how-to-build-a-chatbot-out-of-your-website-content/ into 4 chunks
Split https://www.paepper.com/blog/posts/ into 3 chunks
Split https://www.paepper.com/blog/posts/build-q-and-a-bot-of-your-website-using-langchain/ into 6 chunks
Split https://www.paepper.com/blog/posts/interactive-visualization-of-stable-diffusion-image-embeddings/ into 9 chunks
Split https://www.paepper.com/blog/posts/semantic-segmentation-with-prototype-based-consistency-regularization/ into 6 chunks
Split https://www.paepper.com/blog/posts/everything-you-need-to-know-about-stable-diffusion/ into 15 chunks
Split https://www.paepper.com/blog/posts/frame-decisions-as-bets-to-improve-decision-making/ into 7 chunks
Split https://www.paepper.com/blog/posts/how-and-why-stable-diffusion-works-for-text-to-image-generation/ into 10 chunksSplit https://www.paepper.com/blog/posts/rethinking-depthwise-separable-convolutions/ into 8 chunks
Split https://www.paepper.com/blog/posts/creating-pleasant-plots-with-seaborn/ into 5 chunks
Split https://www.paepper.com/blog/posts/dino-emerging-properties-in-self-supervised-vision-transformers/ into 10 chunksSplit https://www.paepper.com/blog/posts/rethinking-batch-in-batchnorm/ into 7 chunks
Split https://www.paepper.com/blog/posts/hyperparameter-tuning-on-numerai-data-with-pytorch-lightning-and-wandb/ into 13 chunks
Split https://www.paepper.com/blog/posts/hyperparameter-tuning-on-numerai-data-with-fastai-and-wandb/ into 10 chunks
Split https://www.paepper.com/blog/posts/p-diff-learning-classifier-with-noisy-labels-based-on-probability-difference-distributions/ into 5 chunks
Split https://www.paepper.com/blog/posts/git-config/ into 4 chunks
Split https://www.paepper.com/blog/posts/bash-string-manipulation/ into 4 chunks
Split https://www.paepper.com/blog/posts/metalearning-from-noisy-labels/ into 12 chunks
Split https://www.paepper.com/blog/posts/refactoring-machine-learning-code-namedtuple/ into 2 chunks
Split https://www.paepper.com/blog/posts/refactoring-machine-learning-code-einops/ into 4 chunks
Split https://www.paepper.com/blog/posts/refactoring-machine-learning-code-comments-as-code/ into 4 chunks
Split https://www.paepper.com/blog/posts/depthwise-separable-convolutions-in-pytorch/ into 8 chunks
Split https://www.paepper.com/blog/posts/pyramidal-convolution-rethinking-convolutional-neural-networks-for-visual-recognition/ into 9 chunks
Split https://www.paepper.com/blog/posts/how-to-properly-manage-ssh-keys-for-server-access/ into 8 chunks
Split https://www.paepper.com/blog/posts/end-to-end-object-detection-with-transformers/ into 12 chunks
Split https://www.paepper.com/blog/posts/accurate-large-minibatch-sgd-training-image-net-in-1-hour/ into 8 chunks
Split https://www.paepper.com/blog/posts/swift_as_a_viable_python_alternative/ into 5 chunks
Split https://www.paepper.com/blog/posts/eigenvectors_eigenvalues_machine_learning/ into 5 chunks
Split https://www.paepper.com/blog/posts/parsing-json-data-from-aws-lambda-functions-in-python/ into 2 chunks
Split https://www.paepper.com/blog/posts/pytorch-multi-gpu-training-for-faster-machine-learning-results/ into 7 chunks
Split https://www.paepper.com/blog/posts/plot-pytorch-tensors-with-matplotlib/ into 2 chunks
Split https://www.paepper.com/blog/posts/do-you-know-which-inputs-your-neural-network-likes-most/ into 8 chunks
Split https://www.paepper.com/blog/posts/shapeshifting-pytorch/ into 3 chunks
Split https://www.paepper.com/blog/posts/what-are-embeddings-in-machine-learning/ into 4 chunks
Split https://www.paepper.com/blog/posts/bash-keep-script-running-restart-on-crash/ into 2 chunks
Split https://www.paepper.com/blog/posts/writing-command-line-tools-in-python-argument-parsing/ into 3 chunks
Split https://www.paepper.com/blog/posts/better-unit-tests-django-using-mommy/ into 4 chunks
Split https://www.paepper.com/blog/posts/pytorch-gpu-inference-with-docker/ into 8 chunks
Split https://www.paepper.com/blog/posts/unfreeze-vim/ into 2 chunks
Split https://www.paepper.com/blog/posts/pytorch-model-in-production-as-a-serverless-rest-api/ into 12 chunks
Split https://www.paepper.com/blog/posts/graphical-explanation-of-neural-networks-and-gradients-with-python-and-numpy/ into 10 chunks
Split https://www.paepper.com/blog/posts/debugging-tensorflow/ into 10 chunks
Split https://www.paepper.com/blog/posts/deep-learning-on-medical-images-with-u-net/ into 9 chunks
Split https://www.paepper.com/blog/posts/build-your-own-javascript-game-in-5-minutes/ into 6 chunks
Split https://www.paepper.com/blog/posts/monte-carlo-for-better-time-estimates-of-your-work/ into 6 chunks
Split https://www.paepper.com/blog/posts/play-video-games-using-neural-networks/ into 13 chunks
Split https://www.paepper.com/blog/posts/vim-commands-you-should-know-about/ into 5 chunks
Split https://www.paepper.com/blog/posts/database-backup-in-the-cloud-using-aws/ into 4 chunks
Split https://www.paepper.com/blog/posts/training-a-neural-network-with-numpy/ into 5 chunks
Split https://www.paepper.com/blog/posts/domain-driven-design-ddd/ into 7 chunks
Split https://www.paepper.com/blog/posts/clean-code-book/ into 5 chunks
Split https://www.paepper.com/blog/posts/javascript-bitwise-operations/ into 6 chunks
Split https://www.paepper.com/blog/posts/mod-rewrite-operations-you-should-know-about/ into 5 chunks
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._completion_with_retry in 8.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._completion_with_retry in 10.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
Traceback (most recent call last):
...

It would be interesting to know how to prevent this. I have checked on https://platform.openai.com/account/usage and I've used so far... $0. I rechecked it an hour later for the metrics to stabilize but still I got the same usage.

mpaepper commented 1 year ago

Sorry, there is nothing to do here from the code side of things, it's about your API key usage, maybe you've entered the wrong API key?

GeiserX commented 1 year ago

Nope, I tried with another API key and it's having the same RateLimitError... I haven't paid for a ChatGPT account, but I have $18 of credits.. Shouldn't be that sufficient?

GeiserX commented 1 year ago

@mpaepper I check whether the env is set but the key is correctly set (when doing an echo $OPENAI_API_KEY) I'm using Ubuntu WSL 2 on Windows... this shouldn't be a problem.

mpaepper commented 1 year ago

Maybe your credit of 18$ has expired? Sorry, cannot be of more help here.

GeiserX commented 1 year ago

Just FYI. It's not used even a single time. It has never been used. image