argmaxinc / WhisperKit

On-device Speech Recognition for Apple Silicon
http://argmaxinc.com/blog/whisperkit
MIT License
3.92k stars 331 forks source link

Unable to delete the model #11

Closed pradeepb28 closed 9 months ago

pradeepb28 commented 9 months ago

It looks like the model is deleted when I use FIleManager removeAt method but when I re-run the project the deleted model appears again.

FileManager.default.removeItem(at: URL.init(string: "file://" + "(path)")!)

atiorh commented 9 months ago

Could you share more details? Is this when you are doing make download-models?

ZachNagengast commented 9 months ago

Also note that the result of

let folder = try await WhisperKit.load(variant: model, from: repoName, progressCallback: { progress in
...
}

will be the exact url of the folder where the models are contained. In order to delete the entire folder, you may want to use something like this:

FileManager.default.removeItem(at: folder)

If that doesn't help then try to check the error that removeItem returns to see if it's telling you anything.

pradeepb28 commented 9 months ago

@ZachNagengast curious why is there a fallback option pointed to "base model" in the framework I found this in WhisperKit class self.modelFolder = URL(filePath: "openai_whisperkit-base")

I wish this could be null because user already has the UI to select to which model they want to load (by default it could be none)

ZachNagengast commented 9 months ago

FYI modelFolder is a now an optional, but we also have a default recommended model depending on hardware type.