Fix unnecessary Ollama model loading (#35032)
Closes https://github.com/zed-industries/zed/issues/35031 Similar solution as in https://github.com/zed-industries/zed/pull/30589 Release Notes: - Fix unnecessary ollama model loading
This commit is contained in:
parent
f21ba9e2c6
commit
5de544eb4b
1 changed files with 8 additions and 4 deletions
|
@ -192,12 +192,16 @@ impl LanguageModelProvider for OllamaLanguageModelProvider {
|
|||
IconName::AiOllama
|
||||
}
|
||||
|
||||
fn default_model(&self, cx: &App) -> Option<Arc<dyn LanguageModel>> {
|
||||
self.provided_models(cx).into_iter().next()
|
||||
fn default_model(&self, _: &App) -> Option<Arc<dyn LanguageModel>> {
|
||||
// We shouldn't try to select default model, because it might lead to a load call for an unloaded model.
|
||||
// In a constrained environment where user might not have enough resources it'll be a bad UX to select something
|
||||
// to load by default.
|
||||
None
|
||||
}
|
||||
|
||||
fn default_fast_model(&self, cx: &App) -> Option<Arc<dyn LanguageModel>> {
|
||||
self.default_model(cx)
|
||||
fn default_fast_model(&self, _: &App) -> Option<Arc<dyn LanguageModel>> {
|
||||
// See explanation for default_model.
|
||||
None
|
||||
}
|
||||
|
||||
fn provided_models(&self, cx: &App) -> Vec<Arc<dyn LanguageModel>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue