mirror of
https://github.com/huggingface/candle.git
synced 2025-06-20 04:00:28 +00:00
fix: fix the codegeex4 model examples and transformers model (#2738)
* Update main.rs * Update codegeex4_9b.rs * Get things to compile. * Add some default for when rope_ratio is missing. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
This commit is contained in:
@ -8,6 +8,10 @@ use crate::models::with_tracing::{linear_b as linear, Linear};
|
||||
use candle::{DType, Device, IndexOp, Module, Result, Tensor, D};
|
||||
use candle_nn::VarBuilder;
|
||||
|
||||
fn default_one() -> usize {
|
||||
1
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Deserialize, Default)]
|
||||
pub struct Config {
|
||||
pub num_layers: usize,
|
||||
@ -29,6 +33,7 @@ pub struct Config {
|
||||
pub apply_query_key_layer_scaling: bool,
|
||||
pub attention_softmax_in_fp32: bool,
|
||||
pub fp32_residual_connection: bool,
|
||||
#[serde(default = "default_one")]
|
||||
pub rope_ratio: usize,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user