WhisperKit icon indicating copy to clipboard operation
WhisperKit copied to clipboard

Unable to delete the model

Open pradeepb28 opened this issue 1 year ago • 2 comments

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)")!)

pradeepb28 avatar Feb 02 '24 12:02 pradeepb28

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

atiorh avatar Feb 02 '24 17:02 atiorh

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.

ZachNagengast avatar Feb 02 '24 17:02 ZachNagengast

@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)

pradeepb28 avatar Feb 03 '24 07:02 pradeepb28

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

ZachNagengast avatar Feb 20 '24 05:02 ZachNagengast