A trait for defining the interface of model loaders.
| 14 | |
| 15 | /// A trait for defining the interface of model loaders. |
| 16 | pub trait LoaderImpl: Send { |
| 17 | /// Sets the device configuration for the loader. |
| 18 | fn set_device(&mut self, device: Arc<DeviceConfig>); |
| 19 | |
| 20 | /// Loads the model and returns it wrapped in an `Arc<Mutex<dyn ModelImpl>>`. |
| 21 | fn load(&mut self) -> Result<Arc<Mutex<dyn ModelImpl>>, CallmError>; |
| 22 | |
| 23 | /// Returns the tokenizer associated with the model. |
| 24 | fn tokenizer(&mut self) -> Result<Tokenizer, CallmError>; |
| 25 | |
| 26 | /// Returns the template associated with the model. |
| 27 | fn template(&mut self) -> Result<Box<dyn TemplateImpl>, CallmError>; |
| 28 | } |
| 29 |
nothing calls this directly
no outgoing calls
no test coverage detected