Merge pull request #1878 from Ja1aia/main

fix timeout issue
This commit is contained in:
Daniel.y 2025-07-30 09:19:46 +08:00 committed by GitHub
commit 444593bda8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ async def _ollama_model_if_cache(
kwargs.pop("max_tokens", None)
# kwargs.pop("response_format", None) # allow json
host = kwargs.pop("host", None)
timeout = kwargs.pop("timeout", None) or 600 # Default timeout 600s
timeout = kwargs.pop("timeout", None)
kwargs.pop("hashing_kv", None)
api_key = kwargs.pop("api_key", None)
headers = {
@ -146,7 +146,7 @@ async def ollama_embed(texts: list[str], embed_model, **kwargs) -> np.ndarray:
headers["Authorization"] = f"Bearer {api_key}"
host = kwargs.pop("host", None)
timeout = kwargs.pop("timeout", None) or 300 # Default time out 300s
timeout = kwargs.pop("timeout", None)
ollama_client = ollama.AsyncClient(host=host, timeout=timeout, headers=headers)
try: