machinewrapped / gpt-subtrans

Open Source project using LLMs to translate SRT subtitles
Other
311 stars 36 forks source link

Cannot reload completed savefile (for Simplified Chinese) #123

Closed yuxi-liu-wired closed 4 months ago

yuxi-liu-wired commented 4 months ago

Here are the test files I used:

test_files.zip

When loading the files in the GUI, I get

Wednesday, 10:16:54 - Unable to load test.srt ('NoneType' object cannot be interpreted as an integer)

LoadSubtitleFile failed.

This is after I fixed the encoding problem by specifying UTF-8 logging as in #121 .

This is also after I finished the entire translation and the finished srt file has been outputted, so the translation has finished correctly. It's just that the loading went wrong. There is no indication of error in the GUI, either. The text is rendered correctly (probably in UTF-8).

image

machinewrapped commented 4 months ago

Thanks for attaching the files, I was able to reproduce the issue and have pushed a quick fix: https://github.com/machinewrapped/gpt-subtrans/commit/7dbec537ba0d7b7bcd2b9cdfe47718f76b7281d9

Not sure how the project file ended up without a start_line_number, but 1 is a safe bet for a default value.

yuxi-liu-wired commented 4 months ago

I have tested the hotfix and confirmed it works.