Bug 499012 - Kdenlive flatpak downloads whisper model to wrong location
Summary: Kdenlive flatpak downloads whisper model to wrong location
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Title Clips & Subtitles (other bugs)
Version First Reported In: 24.12.1
Platform: Flatpak Linux
: HI normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2025-01-22 15:26 UTC by frafortunelli
Modified: 2025-06-10 09:56 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 25.04.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description frafortunelli 2025-01-22 15:26:28 UTC
SUMMARY
Speech to text setup on kdenlive flatpak downloads whisper model to wrong location, thus speech to text does not work without manual copying of file. 

STEPS TO REPRODUCE
1. settings -> configure kdenlive -> speech to text -> install multimodal translation 
2. install whisper turbo model 
3. run speech to text 
4. whisper model is downloaded to ~/.cache/whisper but kdenlive cannot find it, and searches for it in ~/.var/app/org.kde.kdenlive/cache/whisper

OBSERVED RESULT
Speech to text does not work

EXPECTED RESULT
Speech to text works 

SOFTWARE/OS VERSIONS
Operating System: Bazzite 41
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.9-203.bazzite.fc41.x86_64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Copying the whisper file from ~/.cache/whisper to /.var/app/org.kde.kdenlive/cache/whisper, speech to text now works.
Comment 1 emohr 2025-01-22 18:36:59 UTC
Thank you for this detailed report.

@JBM another path issue for Wisper on flatpack.
Comment 2 Bruno Cabral 2025-01-29 03:34:57 UTC
Just had the same issue.
Wanted to add that if one creates folder ~/.var/app/org.kde.kdenlive/cache/whisper in advance, the model is downloaded in the correct location.
Comment 3 Jean-Baptiste Mardelle 2025-01-30 09:57:12 UTC
Git commit e176514b6733a9b33fb7180f54ff89ddf344e6a8 by Jean-Baptiste Mardelle.
Committed on 30/01/2025 at 09:56.
Pushed by mardelle into branch 'master'.

Try to fix Whisper models folder on Flatpak

M  +13   -3    src/pythoninterfaces/speechtotextwhisper.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/e176514b6733a9b33fb7180f54ff89ddf344e6a8
Comment 4 Jean-Baptiste Mardelle 2025-01-30 09:57:38 UTC
Git commit 1d468e892e8fd034d020f1e4c7c1144b573bbcf0 by Jean-Baptiste Mardelle.
Committed on 30/01/2025 at 09:49.
Pushed by mardelle into branch 'release/24.12'.

Try to fix Whisper models folder on Flatpak

M  +16   -3    src/pythoninterfaces/speechtotextwhisper.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/1d468e892e8fd034d020f1e4c7c1144b573bbcf0
Comment 5 Awadea 2025-03-07 16:48:29 UTC
With the Appimage on CachyOS (Arch based) no speech model installed and the download won't start because of no existing folder under .cache/whisper. I've created this folder and the download starts correctly and kdenlive finds the files after downloading.
Comment 6 ugjka 2025-05-16 18:27:34 UTC
Problem still present in

```
[ugjka@ugjka ~]$ flatpak info org.kde.kdenlive

Kdenlive - Video editor

          ID: org.kde.kdenlive
         Ref: app/org.kde.kdenlive/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 25.04.1
     License: GPL-3.0-only
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 241,1 MB
     Runtime: org.kde.Platform/x86_64/6.9
         Sdk: org.kde.Sdk/x86_64/6.9

      Commit: 1e36391e875577fd4cd61f5a02e7e52d1cf22598a625d235d49546fd39b77c0c
      Parent: 10ad8cc7863c8d7ec1e26408ca56957b782d1be933c15534a7205ed66b0e98fd
     Subject: Merge pull request #547 from flathub/update-master-cd165ef (7d38d80ed236)
        Date: 2025-05-14 18:10:34 +0000
```
Comment 7 Veronica 2025-05-23 16:52:13 UTC
I'm also seeing the bug on 25.04.1 via Flathub.

So it looks to me like whisperquery.py (or something else in the chain) should check for the existence of the "whisper" subdirectory inside $XDG_CACHE_HOME? And then maybe if not found, create it? 

When I manually created that from within the Flatpak environment, all worked as expected.

I put together a YouTube video showing how I worked around this here: https://www.youtube.com/watch?v=uRg498ExSOg
Of course, to get to the Flatpak terminal interface you'll need: flatpak run --command=/bin/bash org.kde.kdenlive

I putzed with this python file in my own VM, and was able to band-aid it together. I've never sent a merge request for Kdenlive so I don't know the process. It's the end of my week but if nobody's built a fix for it I'm happy to give it a try- it's a quick one.