load_equine_model
load_equine_model(model_path, device=None, *, embedding_model=None)
ยค
Attempt to load an EQUINE model from a file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_path
|
str
|
The path to the model file |
required |
device
|
str | None
|
The device to load the model onto. Overrides the device recorded in the file; by default the model lands on the saved device. |
None
|
embedding_model
|
Module | None
|
Keyword-only. Use this module as the embedding architecture instead of rebuilding it from the file's recipe; the file's weights are loaded into it, and its floating-point tensors take their stored dtypes. |
None
|
Returns:
| Type | Description |
|---|---|
Equine
|
The loaded EQUINE model |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model type is missing or unknown, the file is not in the
current EQUINE format (files from earlier releases must first be
rewritten with |
Notes
Loading runs no code from the file: it is read with restricted unpickling (see
utils.load_checkpoint) and its embedding model is rebuilt through the
architecture registry.
Source code in src/equine/load_equine_model.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |