Open ooyamatakehisa opened 1 year ago
Changing a model started to be executed in the queue for recognizing in #299 and this makes the model change safe while recognizing. Thus the crash by downloading a model doen't happen anyomore. But if you start recognizing while downloading another model, the model is changed anytime while recognizing.
Downloading model (downloading the parameter file of a model) is executed in WhisperModelRepository.fetchWhisperModel
and this function uses FileDownloader.donwloadFile
function. This function execute a download asynchronously so a task to download a model can't be easily added to the recognition queue inorder to execute recotnition tasks and the download task serially.
This crash happens because model is changed after the download finishes. We have to disable recognition while downloading model. Or we can prevent this crash by adding a task that changes the model to DispatchQueue for recognitions
related issues
46
222
282