mirror of
https://github.com/tcsenpai/youlama.git
synced 2025-06-07 03:35:41 +00:00
better model selection
This commit is contained in:
parent
51e5e5eefe
commit
971422688c
@ -88,10 +88,18 @@ class OllamaHandler:
|
|||||||
if not self.is_available():
|
if not self.is_available():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
is_valid, model = self.validate_model(self.default_model)
|
available_models = self.get_available_models()
|
||||||
if is_valid:
|
if not available_models:
|
||||||
return model
|
return None
|
||||||
return None
|
|
||||||
|
if self.default_model in available_models:
|
||||||
|
logger.info(f"Using configured default model: {self.default_model}")
|
||||||
|
return self.default_model
|
||||||
|
|
||||||
|
logger.warning(
|
||||||
|
f"Configured model '{self.default_model}' not found in available models. Using first available model: {available_models[0]}"
|
||||||
|
)
|
||||||
|
return available_models[0]
|
||||||
|
|
||||||
def summarize(self, text: str, model: Optional[str] = None) -> Optional[str]:
|
def summarize(self, text: str, model: Optional[str] = None) -> Optional[str]:
|
||||||
"""Summarize text using Ollama."""
|
"""Summarize text using Ollama."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user