Skip to content

euroeval.safetensors_utils

source module euroeval.safetensors_utils

Utility functions related to parsing of safetensors metadata of models.

Functions

source get_num_params_from_safetensors_metadata(model_id: str, revision: str, api_key: str | None)int | None

Get the number of parameters from the safetensors metadata.

Parameters

  • model_id : str The model ID.

  • revision : str The revision of the model.

  • api_key : str | None The API key to use for authentication with the Hugging Face Hub. Can be None if no API key is needed.

Returns

  • int | None The number of parameters, or None if the metadata could not be found.