Remote end closed connection without response, gpt-3.5-turbo

I did see a comment regarding this behaviour re: gpt-4, but I’m using gpt-3.5-turbo.

I’m using the completions API to translate SRT (subtitle) files from English to Spanish, and it works quite well—on small files.

The total amount of text to be translated is 39,255 tokens, so I realized I would have to break it up into pieces. The documentation states that the maximum total tokens per request is 4096. Since the translations are only slightly larger in Spanish than in English, I expected that sending a conservative number in the request, say 2000, would be satisfactory. However, I’m getting the “connection closed” response even for that, and even for shorter queries.

That error is not exactly helpful. So, in part, this is a request for better error reporting.

But I’m wondering if there is something I’m missing here that is causing the process to abort. Any ideas?

Any help would be appreciated.

Hi @liamk

Welcome to the community.

Are you sure you aren’t exceeding your rate limits?

Thank you, @sps. I hadn’t thought of that.

I checked and I don’t think rate limits are a factor. Although I’m in my first 48 hours, so they are reduced.

I just sent one request with 999 tokens, plus a couple of sentences for the prompt.
That is well within the rate limit. Again, I’m getting the connection closed message.

It does work when I send a request with 398 tokens (+prompt), however.