mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Add a quantized blip model. (#1155)
* Add a quantized blip model. * Integrate the quantized blip model to the actual example.
This commit is contained in:
@ -34,6 +34,12 @@ pub struct Linear {
|
||||
bias: Option<Tensor>,
|
||||
}
|
||||
|
||||
impl Linear {
|
||||
pub fn from_weights(weight: QMatMul, bias: Option<Tensor>) -> Self {
|
||||
Self { weight, bias }
|
||||
}
|
||||
}
|
||||
|
||||
impl Module for Linear {
|
||||
fn forward(&self, x: &Tensor) -> candle::Result<Tensor> {
|
||||
let x = x.apply(&self.weight)?;
|
||||
|
Reference in New Issue
Block a user