langtest.utils.hf_utils.get_model_n_tokenizer#

get_model_n_tokenizer(model_name)#

Load a pre-trained model and tokenizer from Hugging Face Model Hub.

Parameters:

model_name (str) – The name or identifier of the pre-trained model.

Returns:

A tuple containing the loaded model and tokenizer.
  • model: The loaded pre-trained model.

  • tokenizer: The tokenizer associated with the model.

Return type:

Tuple

Raises:

GatedRepoAccessError – If there is an attempt to access a gated repository without proper authorization.