Add GLM 5.3 Flash support
This commit is contained in:
@@ -34,8 +34,8 @@ impl SpeculativePreferences {
|
||||
if self.glm_mtp_timing && !self.glm_mtp {
|
||||
return Err("GLM MTP timing requires GLM MTP.".into());
|
||||
}
|
||||
if model != ModelChoice::Glm52 && (self.glm_mtp || self.glm_mtp_timing) {
|
||||
return Err("GLM MTP is available only for GLM 5.2.".into());
|
||||
if !model.supports_glm_mtp() && (self.glm_mtp || self.glm_mtp_timing) {
|
||||
return Err("GLM MTP is available only for GLM models.".into());
|
||||
}
|
||||
if self.dspark_enabled && !model.supports_dspark() {
|
||||
return Err("DSpark is not available for the selected model.".into());
|
||||
@@ -166,8 +166,8 @@ impl SsdPreferences {
|
||||
{
|
||||
return Err("SSD full-layer count is too large.".into());
|
||||
}
|
||||
if self.full_layers.is_some_and(|layers| layers > 0) && model != ModelChoice::Glm52 {
|
||||
return Err("Fully resident SSD layers are available only for GLM 5.2.".into());
|
||||
if self.full_layers.is_some_and(|layers| layers > 0) && !model.is_glm() {
|
||||
return Err("Fully resident SSD layers are available only for GLM models.".into());
|
||||
}
|
||||
if let Some(StreamingCacheBudget::Gib(gib)) = self.cache {
|
||||
validate_gib("SSD cache budget", gib)?;
|
||||
@@ -443,12 +443,12 @@ impl ExecutionPreferences {
|
||||
{
|
||||
return Err("Prefill chunk is too large.".into());
|
||||
}
|
||||
if model == ModelChoice::Glm52 {
|
||||
if model.is_glm() {
|
||||
if self.power_percent.is_some_and(|power| power != 100) {
|
||||
return Err("GLM 5.2 currently requires 100% GPU power.".into());
|
||||
return Err("GLM currently requires 100% GPU power.".into());
|
||||
}
|
||||
if self.prefill_chunk.is_some() {
|
||||
return Err("GLM 5.2 selects its prefill chunk automatically.".into());
|
||||
return Err("GLM selects its prefill chunk automatically.".into());
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@@ -569,7 +569,7 @@ impl GenerationPreferences {
|
||||
model: ModelChoice,
|
||||
kv_cache: KvCacheSettings,
|
||||
) -> TurnSettings {
|
||||
let glm = model == ModelChoice::Glm52;
|
||||
let glm = model.is_glm();
|
||||
TurnSettings {
|
||||
kv_cache,
|
||||
context_tokens: self.context_tokens,
|
||||
|
||||
Reference in New Issue
Block a user