cherry-pick 844537e3
This commit is contained in:
parent
5d8f563b70
commit
4666b63e3e
1 changed files with 1 additions and 5 deletions
|
|
@ -37,13 +37,9 @@ def _coerce_host_for_cloud_model(host: Optional[str], model: object) -> Optional
|
||||||
return host
|
return host
|
||||||
try:
|
try:
|
||||||
model_name_str = str(model) if model is not None else ""
|
model_name_str = str(model) if model is not None else ""
|
||||||
except (TypeError, ValueError, AttributeError) as e:
|
except Exception:
|
||||||
logger.warning(f"Failed to convert model to string: {e}, using empty string")
|
|
||||||
model_name_str = ""
|
model_name_str = ""
|
||||||
if _CLOUD_MODEL_SUFFIX_PATTERN.search(model_name_str):
|
if _CLOUD_MODEL_SUFFIX_PATTERN.search(model_name_str):
|
||||||
logger.debug(
|
|
||||||
f"Detected cloud model '{model_name_str}', using Ollama Cloud host"
|
|
||||||
)
|
|
||||||
return _OLLAMA_CLOUD_HOST
|
return _OLLAMA_CLOUD_HOST
|
||||||
return host
|
return host
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue