Fixed test

This commit is contained in:
Raivis Dejus 2026-03-07 15:51:04 +02:00
commit d14d4b8d09

View file

@ -325,14 +325,15 @@ class RecordingTranscriber(QObject):
self.error.emit(str(exc))
return
self.finished.emit()
# Cleanup
# Cleanup before emitting finished to avoid destroying QThread
# while this function is still on the call stack
if model:
del model
if torch.cuda.is_available():
torch.cuda.empty_cache()
self.finished.emit()
@staticmethod
def get_device_sample_rate(device_id: Optional[int]) -> int:
"""Returns the sample rate to be used for recording. It uses the default sample rate