artefactual.utils.io#
Functions
|
Loads calibration coefficients from a built-in model name OR a local file path. |
|
Loads weights from a built-in model name or a local file path. |
- artefactual.utils.io.load_calibration(identifier)[source]#
Loads calibration coefficients from a built-in model name OR a local file path.
- Args:
identifier: The model name (e.g., “tiiuae/Falcon3-10B-Instruct”) or a path to a JSON file.
- Returns:
A dictionary containing the calibration coefficients (e.g., “intercept”, “coefficients”).
- Raises:
- ValueError: If the identifier is not found in the registry and is not a valid file path,
or if the file is not valid JSON.
- artefactual.utils.io.load_weights(identifier)[source]#
Loads weights from a built-in model name or a local file path.
- Args:
identifier: Either a built-in model name (as listed in MODEL_WEIGHT_MAP) or a path to a local JSON file containing weights.
- Returns:
A dictionary mapping string keys to float values representing the weights.
- Raises:
ValueError: If the identifier is not a supported model name, the file does not exist, or the file is not valid JSON.