-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation scripts stops after a few minutes #5
Comments
I have not used this script, but OpenAI is having issues with their API service for the last few days, including today. |
No, right now I wait until the AlpacaDataCleaned progresses further, then I'll try again. |
Exceptions blocking the task execution is the most probable cause of this issue. The ratelimits are per account, typically very small 90000 tokens / minute. Start with 10 threads. Had this problem for myself and traced it. You can add simple handling for to translate_text. I'm not sure are ratelimited requests billed in openai's API. I suggest testing the translation script with a smaller chunk. 0-100 for example. Here is what you need to catch
This will lead to But please check the billing terms of how execption request are handled before adding retry to the requests in openai first, this may become very expensive other vice. Retrying the request with backoff on exception as per openai's official documentation which I've implemented and using now.
I'm being ratelimited so much that even using only 10 threads it takes ~5 minutes to translate 350 complete instruction prompts with system, user and output. Insane. Br; |
Thanks for the analysis, very interesting. Maybe just paying for the Google Translate or DeepL API instead could be a better option? |
Hi, I'm unfamiliar with the these other translate services, but I'll surely look them up. I think if any of them have by default better rate limits they are better worth if they are priced accordingly. For me 1000 alpaca-lora cleaned promprts was around $0.75-1 with openai while debugging this code, but the rate-limit is killing producitvity to accomplish this in the matter of time I could with threads. I created a whole rewrite of the code that now translates the whole prompt object string values, but not the keys and is tuned for performance. This is still slow 100-150/minute, due to spurious rate-limits on openai "model busy"/"ratelimit reached" then falling to exponential backoff timer.
|
DeepL API https://www.deepl.com/pro#developer
-- This is actually much more expensive : D |
After 1-4% the translation script stops changing numbers and looks like this:
I experimented with lower numbers of parallel calls, but nothing really seems to help.
Any ideas? Could this be related to the rate limits? Is it just a visual issue?
The text was updated successfully, but these errors were encountered: