BF: Fix whisper transcriber sometimes being initialised twice (and breaking as a result)#6796
Merged
TEParsons merged 1 commit intopsychopy:releasefrom Aug 19, 2024
Conversation
…o load psychopy.sound
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release #6796 +/- ##
===========================================
- Coverage 49.64% 49.62% -0.02%
===========================================
Files 332 332
Lines 61129 61172 +43
===========================================
+ Hits 30345 30356 +11
- Misses 30784 30816 +32
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
psychopy-whisperdefines an entry point targeting its transcriber, whisper is initialised wheneveractivatePluginsis called. Because the PsychoPy app runs in a different process to experiments, running a whisper experiment from Builder was loading whisper's DLLs twice in two processes, which whisper doesn't like.The reason the entry point was needed is that
psychopy.sound.setupTranscriberneeds to know what class to setup from name, and to detect this it needed to have been loaded via entry point. The solution is to not refer to it by name from Builder, and instead simply give the full path as a string (so thatsetupTranscribercan then import it from the string).Accompanying commit in the psychopy-whisper repo:
psychopy/psychopy-whisper@4d82ae4
(we'll need to do a release of this to match)