Skip to content

Commit

Permalink
working on supporting falcon model
Browse files Browse the repository at this point in the history
Signed-off-by: José Carlos García <hola@josecarlos.me>
  • Loading branch information
JoseCarlosGarcia95 committed Dec 17, 2024
1 parent 81067cb commit eb2f37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion candle-examples/examples/llama-bitnet/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ enum Which {
BitnetB1_58Large,
Bitnet51_58XL,
Bitnet51_38_3B,
Falcon3_7bInstruct158,
}

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -128,6 +129,7 @@ fn main() -> Result<()> {
Which::BitnetB1_58Large => "1bitLLM/bitnet_b1_58-large",
Which::Bitnet51_58XL => "1bitLLM/bitnet_b1_58-xl",
Which::Bitnet51_38_3B => "1bitLLM/bitnet_b1_38-3b",
Which::Falcon3_7bInstruct158 => "tiiuae/Falcon3-7B-Instruct-1.58bit",
};
str.to_string()
});
Expand All @@ -141,7 +143,7 @@ fn main() -> Result<()> {
let config = config.into_config(args.use_flash_attn);

let filenames = match args.which {
Which::BitnetB1_58Large => {
Which::Falcon3_7bInstruct158 | Which::BitnetB1_58Large => {
vec![api.get("model.safetensors")?]
}
Which::Bitnet51_38_3B | Which::Bitnet51_58XL => {
Expand Down
2 changes: 1 addition & 1 deletion candle-transformers/src/models/llama_bitnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Implementation based on Hugging Face's [transformers](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py)
use super::with_tracing::{bit_linear_no_bias as bit_linear, linear, BitLinear, Linear, RmsNorm};
use super::with_tracing::{bit_linear_no_bias as bit_linear, linear_no_bias as linear, BitLinear, Linear, RmsNorm};
use candle::{DType, Device, IndexOp, Result, Tensor, D};
use candle_nn::{embedding, Embedding, Module, VarBuilder};
use std::{collections::HashMap, f32::consts::PI};
Expand Down

0 comments on commit eb2f37c

Please sign in to comment.