Skip to content

Add configurable AI models folder - #14029

Closed
muaz978 wants to merge 4 commits into
SubtitleEdit:mainfrom
muaz978:feat/configurable-models-folder-14024
Closed

muaz978 wants to merge 4 commits into
SubtitleEdit:mainfrom
muaz978:feat/configurable-models-folder-14024

Conversation

@muaz978

@muaz978 muaz978 commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Fixes #14024.

Adds an optional AI models folder setting so large downloaded model files can be stored on an external SSD without moving Subtitle Edit's settings, logs, dictionaries, themes, or executable folders.

What is covered

  • Adds Options > General > AI models folder with a folder picker.
  • Preserves all historical locations when the setting is empty.
  • Redirects managed Whisper, CTranslate2, Whisper.cpp, Purfview, CrispASR, TTS, Qwen3 ASR, llama.cpp, PaddleOCR, CrispEmbed, Tesseract, and audio.cpp model paths.
  • Uses XDG_CACHE_HOME for OpenAI Whisper and HF_HOME for CTranslate2 when a custom root is selected.
  • Keeps engine binaries in the normal application-data folder.
  • Adds focused compatibility tests and detailed implementation documentation.

Migration behavior

Existing models are not moved automatically. The setting changes future model resolution and downloads, while the documentation explains the manual copy layout. This avoids destructive or interrupted multi-gigabyte moves.

Verification

AVALONIA_TELEMETRY_OPTOUT=1 dotnet test tests/UI/UITests.csproj --no-restore --filter FullyQualifiedName~DataFolderLocationTests

Result: 6 passed, 0 failed.

Also verified with git diff --check.

# Conflicts:
#	src/ui/Logic/Config/Se.cs
… headless-UI dispatcher flake, unrelated to this change)
# Conflicts:
#	src/ui/Features/Video/SpeechToText/SpeechToTextAdvancedViewModel.cs
#	src/ui/Logic/Config/Se.cs
Blackspirits added a commit to Blackspirits/subtitleedit that referenced this pull request Sep 14, 2026
Audited current-base port of upstream PR SubtitleEdit#14029 with CrispASR cache routing hardening and coverage for all current CrispASR-backed TTS engines.
Blackspirits added a commit to Blackspirits/subtitleedit that referenced this pull request Sep 14, 2026
Audited current-base port of upstream PR SubtitleEdit#14029 with CrispASR cache routing hardening, caller-environment compatibility, and coverage for all current CrispASR-backed TTS engines.
Blackspirits added a commit to Blackspirits/subtitleedit that referenced this pull request Sep 14, 2026
Audited current-base port of upstream PR SubtitleEdit#14029 with complete current-tree model routing, CrispASR cache hardening, WhisperX Hugging Face routing, audio.cpp and Piper coverage, and focused regressions.
Blackspirits added a commit to Blackspirits/subtitleedit that referenced this pull request Sep 14, 2026
Audited current-base port of upstream PR SubtitleEdit#14029 with complete current-tree model routing, CrispASR cache hardening, WhisperX Hugging Face routing, audio.cpp and Piper coverage, path normalization, and focused regressions.
@niksedk

niksedk commented Sep 14, 2026

Copy link
Copy Markdown
Member

Hi @muaz978, thanks for the thorough work here - the model-path audit across all the engines alone is useful, and the "don't move multi-gigabyte files automatically" call is the right one.

I'm closing this one though. Touching every engine class (57 files) to redirect its model path is more surface than I want to carry for this, and the branch has drifted into conflicts with main since the engines have kept moving. If I add a configurable models folder, I'd like to do it in one place at the Configuration level, so the engines don't each need to know about it - and your list of which engines resolve their models where will be a handy map when I get to it.

I'll keep #14024 open as the feature request. Thanks again!

@niksedk niksedk closed this Sep 14, 2026
@muaz978

muaz978 commented Sep 14, 2026

Copy link
Copy Markdown
Author

Understood, and the scope and conflict concerns are fair. 57 files is a lot of surface for this. Glad the model-path audit is useful as a reference for when you get to the Configuration-level version. I'll leave it to you, happy to help once you've settled on the shape you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Allow changing the models folder location

2 participants