From 86e7d539d253740d5a0579e6f53acc12e30d3e4c Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Wed, 18 Oct 2023 16:29:38 +0100 Subject: Add the quantized mpt model. (#1123) * Add the quantized mpt model. * Support the quantized model for replit-code. --- candle-transformers/src/quantized_nn.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'candle-transformers/src/quantized_nn.rs') diff --git a/candle-transformers/src/quantized_nn.rs b/candle-transformers/src/quantized_nn.rs index 1745327d..d71c3b60 100644 --- a/candle-transformers/src/quantized_nn.rs +++ b/candle-transformers/src/quantized_nn.rs @@ -59,6 +59,11 @@ pub fn layer_norm(size: usize, eps: f64, vb: VarBuilder) -> Result Result { + let weight = vb.get(size, "weight")?.dequantize(vb.device())?; + Ok(candle_nn::LayerNorm::new_no_bias(weight, eps)) +} + pub fn linear_no_bias(in_dim: usize, out_dim: usize, vb: VarBuilder) -> Result { let weight = QMatMul::new(in_dim, out_dim, vb)?; Ok(Linear { weight, bias: None }) -- cgit v1.2.3