Skip to content

Commit

Permalink
Allow setting a downloadBase so downloaded models are not forced into…
Browse files Browse the repository at this point in the history
… the user's Documents folder (#34)

* Allow setting a downloadBase so downloaded models are not forced into the user's Documents folder

* Update Sources/WhisperKit/Core/WhisperKit.swift

Co-authored-by: Zach Nagengast <[email protected]>

---------

Co-authored-by: Atila Orhon <[email protected]>
Co-authored-by: Zach Nagengast <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2024
1 parent 228630c commit 8d581f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/WhisperKit/Core/WhisperKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public class WhisperKit {
return sortedModels
}

public static func download(variant: String, from repo: String = "argmaxinc/whisperkit-coreml", progressCallback: ((Progress) -> Void)? = nil) async throws -> URL? {
let hubApi = HubApi()
public static func download(variant: String, downloadBase: URL? = nil, from repo: String = "argmaxinc/whisperkit-coreml", progressCallback: ((Progress) -> Void)? = nil) async throws -> URL? {
let hubApi = HubApi(downloadBase: downloadBase)
let repo = Hub.Repo(id: repo, type: .models)
do {
let modelFolder = try await hubApi.snapshot(from: repo, matching: ["*\(variant.description)/*"]) { progress in
Expand Down

0 comments on commit 8d581f4

Please sign in to comment.