openly-jp / voiscribe

1 stars 0 forks source link

App crashed when starting a recognition while dowloading a model #300

Open ooyamatakehisa opened 1 year ago

ooyamatakehisa commented 1 year ago

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

ooyamatakehisa commented 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.

ooyamatakehisa commented 1 year ago

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.