Skip to content

Use specific version of a model hosted on Hugginface  #1509

@hbredin

Description

@hbredin

huggingface_hub.hf_hub_download supports passing a revision parameter to hf_hub_{url|download} to load a specific version (understand: commit, tag, or branch head) of models hosted on Huggingface Hub:

from huggingface_hub import hf_hub_download
hf_hub_url(repo_id, filename, revision=..., ...)

It would be nice to expose this revision parameter in speechbrain so that one can pin a model to a specific version (and ensure that a given code will still behave the same even if the model is updated upstream).

The API could look like this:

from speechbrain.pretrained import EncoderClassifier
encoder = EncoderClassifier.from_hparams(
    source="speechbrain/spkrec-ecapa-voxceleb",
    revision="5c0be3875fda05e81f3c004ed8c7c06be308de1e",
)

or maybe like this that @julien-c implemented for pyannote.audio:

from speechbrain.pretrained import EncoderClassifier
encoder = EncoderClassifier.from_hparams(
    source="speechbrain/spkrec-ecapa-voxceleb@5c0be3875fda05e81f3c004ed8c7c06be308de1e")

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