feat: DeepSeek V4 Flash 0731 added

This commit is contained in:
Georg Bauer
2026-08-01 08:40:06 +02:00
parent 4175706533
commit d1c380f79d
7 changed files with 85 additions and 21 deletions

View File

@@ -223,10 +223,11 @@ pub(super) fn validate_main(model: &Gguf, expected: ModelChoice) -> Result<Shape
};
let shape = match family {
ModelFamily::Glm => GLM,
ModelFamily::DeepSeek => match model.u32("deepseek4.block_count")? {
43 => FLASH,
61 => PRO,
layers => return Err(format!("unsupported DeepSeek layer count: {layers}")),
ModelFamily::DeepSeek => match (model.u32("deepseek4.block_count")?, expected) {
(43, ModelChoice::DeepSeekV4Flash0731) => FLASH_0731,
(43, _) => FLASH,
(61, _) => PRO,
(layers, _) => return Err(format!("unsupported DeepSeek layer count: {layers}")),
},
};
if shape.model != expected {
@@ -993,10 +994,18 @@ fn float_eq(actual: f32, expected: f32) -> bool {
fn compression_ratio(shape: &Shape, layer: u32) -> u32 {
match shape.model {
ModelChoice::DeepSeekV4Flash if layer < 2 => 0,
ModelChoice::DeepSeekV4Flash | ModelChoice::DeepSeekV4Flash0731 if layer < 2 => 0,
ModelChoice::DeepSeekV4Pro if layer < 2 => 128,
ModelChoice::DeepSeekV4Flash | ModelChoice::DeepSeekV4Pro if layer.is_multiple_of(2) => 4,
ModelChoice::DeepSeekV4Flash | ModelChoice::DeepSeekV4Pro => 128,
ModelChoice::DeepSeekV4Flash
| ModelChoice::DeepSeekV4Flash0731
| ModelChoice::DeepSeekV4Pro
if layer.is_multiple_of(2) =>
{
4
}
ModelChoice::DeepSeekV4Flash
| ModelChoice::DeepSeekV4Flash0731
| ModelChoice::DeepSeekV4Pro => 128,
ModelChoice::Glm52 => 0,
}
}