More model cloning. (#1126)

* More model cloning.

* More cloning on quantized models.
This commit is contained in:
Laurent Mazare
2023-10-18 21:55:46 +01:00
committed by GitHub
parent 185b54a33b
commit 902d0b9166
4 changed files with 19 additions and 19 deletions

View File

@ -2,7 +2,7 @@ use crate::models::with_tracing::QMatMul;
use crate::quantized_var_builder::VarBuilder;
use candle::{Module, Result, Tensor};
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Embedding {
inner: candle_nn::Embedding,
span: tracing::Span,
@ -28,7 +28,7 @@ impl Module for Embedding {
}
}
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Linear {
weight: QMatMul,
bias: Option<Tensor>,
@ -69,7 +69,7 @@ pub fn linear_no_bias(in_dim: usize, out_dim: usize, vb: VarBuilder) -> Result<L
Ok(Linear { weight, bias: None })
}
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RmsNorm {
inner: candle_nn::RmsNorm,
span: tracing::Span,