machinewrapped / gpt-subtrans

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

Implemented a provider cache #142

Closed machinewrapped closed 3 months ago

machinewrapped commented 3 months ago

Recreating translation providers resets any cached values, e.g. available models, and retrieving them can be slow. Added a provider cache so that the providers should only need to be created once each.

There is a trade-off, making sure that the provider settings are updated when options change. A convenient balance is to create a new cache when a new project is started/loaded, since that creates a new datamodel.