Cerlancism/chatgpt-subtitle-translator

Error using --model argument with gpt-4

LiamK opened this issue · 2 comments

LiamK commented

When using the --model parameter with gpt-4 (or gpt-4-0613 as in the example below), an error is thrown.

cli/translator.mjs --from English --to Spanish --file ~/Movies/Rendered/BlueOrangesRetimed.srt --model 'gpt-4-0613' [CLI] Assume SRT file /Users/liam/Movies/Rendered/BlueOrangesRetimed.srt [CLI] Progress already completed /Users/liam/Movies/Rendered/BlueOrangesRetimed.srt.progress_Spanish.csv [CLI] Overwriting /Users/liam/Movies/Rendered/BlueOrangesRetimed.srt.progress_Spanish.csv [CLI] Overwriting /Users/liam/Movies/Rendered/BlueOrangesRetimed.srt.out_Spanish.srt [Translator] System Instruction: Translate English to Spanish [Error_TranslationPrompt] 2023-07-13T12:55:54.232Z Status undefined Error socket hang up undefined

However, it works fine specifying gpt-3.5-turbo, or letting it default to that.
Another application appears to be able to access the gpt-4 API.

Works at my side.

image

The full response of 100 lines using gpt-4 might be too long and timed out.

Try to turn on --stream mode

For your example

cli/translator.mjs --stream --from English --to Spanish --file ~/Movies/Rendered/BlueOrangesRetimed.srt --model gpt-4-0613
LiamK commented

It just started working for me, too.
Ah, apparently the --stream parameter is necessary. Didn't realize that.
Thanks for the quick reply.