yazinsai / srt-ai

Translate SRT files to any language, using AI magic ✨
https://translatesrt.com/
193 stars 50 forks source link

Error: failed to pipe response and Error: OpenAI API returned an error #11

Closed paulineczkapl closed 7 months ago

paulineczkapl commented 8 months ago

Nothing happend, when I try to translate srt file. What's wrong?

paulineczkapl commented 8 months ago

⨯ Error: failed to pipe response at pipeToNodeResponse (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\pipe-readable.js:111:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async sendResponse (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\send-response.js:40:13) at async doRender (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:1360:25) at async cacheEntry.responseCache.get.routeKind (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:1552:28) at async DevServer.renderToResponseWithComponentsImpl (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:1460:28) at async DevServer.renderPageComponent (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:1843:24) at async DevServer.renderToResponseImpl (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:1881:32) at async DevServer.pipeImpl (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:909:25) at async NextNodeServer.handleCatchallRenderRequest (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\next-server.js:266:17) at async DevServer.handleRequestImpl (C:\Users\pauli\Desktop\Translator\srt-ai\node_modules\next\dist\server\base-server.js:805:17) { [cause]: Error: OpenAI API returned an error at retrieveTranslation (webpack-internal:///(rsc)/./app/api/route.ts:46:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.start (webpack-internal:///(rsc)/./app/api/route.ts:62:38) }

romanrsr commented 8 months ago

same here

romantci2710 commented 8 months ago

⨯ Error: failed to pipe response at pipeToNodeResponse (C:\Users\admin\srt-ai\node_modules\next\dist\server\pipe-readable.js:111:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async sendResponse (C:\Users\admin\srt-ai\node_modules\next\dist\server\send-response.js:40:13) at async doRender (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:1360:25) at async cacheEntry.responseCache.get.routeKind (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:1552:28) at async DevServer.renderToResponseWithComponentsImpl (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:1460:28) at async DevServer.renderPageComponent (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:1843:24) at async DevServer.renderToResponseImpl (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:1881:32) at async DevServer.pipeImpl (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:909:25) at async NextNodeServer.handleCatchallRenderRequest (C:\Users\admin\srt-ai\node_modules\next\dist\server\next-server.js:266:17) at async DevServer.handleRequestImpl (C:\Users\admin\srt-ai\node_modules\next\dist\server\base-server.js:805:17) { [cause]: Error: OpenAI API returned an error at retrieveTranslation (webpack-internal:///(rsc)/./app/api/route.ts:46:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.start (webpack-internal:///(rsc)/./app/api/route.ts:62:38)

mateuspaiao commented 8 months ago

Same problem here

froster2006 commented 8 months ago

same error here

macleod-be commented 8 months ago

I had the same issues, no other debug info available in the app. So what I did is using the postmancollection (- https://www.postman.com/devrel/workspace/openai/documentation/13183464-90abb798-cb85-43cb-ba3a-ae7941e968da ) And entered my api-key

  1. test with a GET -> ok
  2. test with a POST -> not ok { "error": { "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.", "type": "insufficient_quota", "param": null, "code": "insufficient_quota" } } So the error was not in de code of Yazin, but in API request !! Finally I found the answer on: https://platform.openai.com/docs/guides/production-best-practices/managing-billing-limits ... To begin using the OpenAI API, enter your billing information. If no billing information is entered, you will still have login access but will be unable to make API requests. ... That's what I did. After aprox 1 hour later, my postman POST was working I restarted srt-ai: Everything worked :-)
froster2006 commented 8 months ago

Thank! working for me now

bwvanlith commented 7 months ago

Doesn't work for me.

My resulting translations have skipped lines because of this (I assume).

GGMaia commented 7 months ago

So is it necessary to pay to use the API after all? Or just enter your card details and you are authorized to use the API?

mlo0352 commented 7 months ago

Thanks, macleod_be for checking the error. I had that suspicion. I suspect that this entire project may be able to be achieved using a less broad local model. I want to investigate that.

yazinsai commented 7 months ago

thanks for the detailed thread (and the investigation @macleod-be!)

@NeroQuill you should be able to get working API keys but there are quota limits. These are low initially, but go up with usage. See https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-three