Cerlancism / chatgpt-subtitle-translator

Efficient translation tool based on ChatGPT API
https://cerlancism.github.io/chatgpt-subtitle-translator/
MIT License
199 stars 16 forks source link

\N in the translated subtitle file #32

Closed sipherh closed 2 months ago

sipherh commented 3 months ago

Thank you for your project, it's great. I have a question: sometimes the original subtitles contain line breaks within the same timeline, and after translation, the subtitles show \N. Is there a parameter to request GPT not to include line breaks, or should I specify this in the prompt? Thanks

Cerlancism commented 3 months ago

This is supposed to be fixed in https://github.com/Cerlancism/chatgpt-subtitle-translator/commit/ce63d7af4f89a04deb1a91b441cf3ce8d9b23a3f

Are you on CLI? Are you on the latest version? Do you use --no-prefix-number ?

Can you provide some sample? But I know it could be hard to reproduce.

sipherh commented 3 months ago

Yes, I am on the CLI and using --no-prefix-number with the latest v2.9.0 version. I was able to remove \N when explicitly telling GPT not to.

Here are the parameters used in my environment. One other thing, the source subtitle file was transcribed through Whisper in Mandarin, without manual auditing; maybe the quality will affect the result.... --model %gpt-version% --batch-sizes [20] --no-prefix-number --temperature %tempvalue% --%system-instruction% --input %source.srt% --output %source_en.srt%