machinewrapped / gpt-subtrans

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

Saved Instructions not loading properly from initial Project Settings #105

Closed Neoony closed 5 months ago

Neoony commented 5 months ago

I saved my own instructions in ...\gui-subtrans\_internal\instructionsMy.txt

When I load some subtitles, the Project Settings window appears. I select Instruction file: instructionsMy.txt

Press OK

Now I go to Translator Settings And here the Instructions are just the default ones. Its not loading them.

I even replaced instructions.txt with my instructions and it anyways loads the default ones from somewhere (from where? hardcoded?)

So now I have to press Load Instructions inside Translator Settings Windows File explorer opens on the path of the last subtitles I opened and I have to go all the way back into the ...\gui-subtrans\_internal folder manually. Usually I make sure to open the ...\gui-subtrans\_internal\ and the subtitles folder in 2 Windows explorer windows when I am about to translate some subtitles, so that I can copy the path easily. But this is quite annoying. And I load the ...\gui-subtrans\_internal\instructionsMy.txt and then my instructions finally appear there. Every episode.

Am I doing something wrong or is this a bug? Or when I load instructions in Project Settings they are loaded but not visible in Translator settings perhaps?

I also wish I could easily load or save the movie description from somewhere within the app. (But this is secondary in this "issue") Otherwise I have to either google them every episode I translate, or save it somewhere in a text file and always have to go get it. Even just having a way to not remove what you had last time you used the app would make this much better. Or if I could at least load the last project and use it on another srt file. (always removes everything for me) But probably ultimately some presets for movie name/description/characters/substitutions would be really nice.

machinewrapped commented 5 months ago

I noticed it not use the instructions I selected in the new project settings the other day too, I don't think it happens 100% but I'll prioritise investigating it because it's a pretty big issue.

Once the project is created it saves the instructions in the project file, so if you want to change them for that project you have to do it via the "Translator Settings" button - you can load a new instructions file or customise them for that project.

The instruction file you select in the general settings should become the default instructions for future projects... but if they aren't being loaded correctly then it isn't very useful. It won't affect the instructions in existing projects either way.

Agreed that being able to load a description, characters and substitutions from a previous project (or somewhere) would be a good quality of life improvement, I'll create a separate issue for that.

machinewrapped commented 5 months ago

OK, I finally found the problem - since PyInstaller changed the way it packages builds to put everything in an "_internal" folder the packaged builds were looking in the wrong place for the instructions file (it assumed they were in the root folder). That's why it wasn't 100% for me - if I run it in the debugger it works fine, it only fails in the packaged releases.

It should be fixed in 0.5.3 - let me know if it works for you. https://github.com/machinewrapped/gpt-subtrans/releases/tag/v0.5.3

I'd prefer it if the instructions files were in the same folder as the executable to be honest, but PyInstaller doesn't provide an option for that so I had to make it treat them as resource files.

Thanks for creating the issue - I was sort of aware something was wrong but I hadn't spotted the pattern, and since I generally run the latest code in the debugger so that I can debug any errors I get I would never see the problem if I was looking for it!

Neoony commented 5 months ago

Yep, tested. Works perfect now. It was also translating fine.

Amazing, Thanks for the fix! ❤️