medkit.tools.hf_utils

medkit.tools.hf_utils#

Functions#

check_model_for_task_hf(→ bool)

Check compatibility of a model with a task HuggingFace.

Module Contents#

medkit.tools.hf_utils.check_model_for_task_hf(model: str | pathlib.Path, task: str, hf_auth_token: str | None = None) bool#

Check compatibility of a model with a task HuggingFace.

The model could be in the HuggingFace hub or in local files.

Parameters:
modelstr or Path

Name (on the HuggingFace models hub) or path of the model.

taskstr

A string representing the HF task to check i.e : ‘token-classification’

hf_auth_tokenstr, optional

HuggingFace Authentication token (to access private models on the hub)

Returns:
bool

Model compatibility with the task