mirror of
https://github.com/huggingface/candle.git
synced 2025-06-20 12:06:35 +00:00
Expose some helper functions to create quantized models. (#1837)
This commit is contained in:
@ -116,6 +116,12 @@ impl QMatMul {
|
||||
let span = tracing::span!(tracing::Level::TRACE, "qmatmul");
|
||||
Ok(Self { inner, span })
|
||||
}
|
||||
|
||||
pub fn from_weights(ws: std::sync::Arc<candle::quantized::QTensor>) -> Result<Self> {
|
||||
let inner = candle::quantized::QMatMul::from_arc(ws)?;
|
||||
let span = tracing::span!(tracing::Level::TRACE, "qmatmul");
|
||||
Ok(Self { inner, span })
|
||||
}
|
||||
}
|
||||
|
||||
impl Module for QMatMul {
|
||||
|
Reference in New Issue
Block a user