Skip to content

The load tokenizer uses the default endpoint; hope adding the add endpoint parameter to download the tokenizer. #388

@lemo366

Description

@lemo366

whisperkit.download allows downloading the CoreML model without using the default endpoint, but the Tokenizer download still uses the default endpoint.

public static func download(
variant: String,
downloadBase: URL? = nil,
useBackgroundSession: Bool = false,
from repo: String = "argmaxinc/whisperkit-coreml",
token: String? = nil,
endpoint: String = Constants.defaultRemoteEndpoint,
progressCallback: ((Progress) -> Void)? = nil
) async throws -> URL {
let hubApi = HubApi(downloadBase: downloadBase, hfToken: token, endpoint: endpoint, useBackgroundSession: useBackgroundSession)
let repo = Hub.Repo(id: repo, type: .models)
var modelSearchPath = "*\(variant.description)/*"

public static func loadTokenizer(
for pretrained: ModelVariant,
tokenizerFolder: URL? = nil,
additionalSearchPaths: [URL] = [],
useBackgroundSession: Bool = false
) async throws -> WhisperTokenizer {
let tokenizerName = tokenizerNameForVariant(pretrained)
let hubApi = HubApi(downloadBase: tokenizerFolder, useBackgroundSession: useBackgroundSession)
let hubTokenizerFolder = hubApi.localRepoLocation(HubApi.Repo(id: tokenizerName))

If I simply add the endpoint parameter to WhisperKitConfig and pass it down, the tokenizer should be able to be downloaded, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions