fix: prioritize predefined model context_limit over canonical registry (#7888)
Signed-off-by: Extra Small <littleshuai.bot@gmail.com> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -111,6 +111,12 @@ impl ModelConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_canonical_limits(mut self, provider_name: &str) -> Self {
|
pub fn with_canonical_limits(mut self, provider_name: &str) -> Self {
|
||||||
|
if let Some(pm) = find_predefined_model(&self.model_name) {
|
||||||
|
if self.context_limit.is_none() {
|
||||||
|
self.context_limit = pm.context_limit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(canonical) =
|
if let Some(canonical) =
|
||||||
crate::providers::canonical::maybe_get_canonical_model(provider_name, &self.model_name)
|
crate::providers::canonical::maybe_get_canonical_model(provider_name, &self.model_name)
|
||||||
{
|
{
|
||||||
@@ -125,13 +131,6 @@ impl ModelConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try filling remaining gaps from predefined models
|
|
||||||
if self.context_limit.is_none() {
|
|
||||||
if let Some(pm) = find_predefined_model(&self.model_name) {
|
|
||||||
self.context_limit = pm.context_limit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user