Add ability to passadditional parameters to ollama library like host and timeout

This commit is contained in:
Andrii Lazarchuk
2024-10-21 11:53:06 +00:00
parent 08caaa0b53
commit 25a2dd41c1
4 changed files with 13 additions and 5 deletions

View File

@@ -88,6 +88,7 @@ class LightRAG:
llm_model_name: str = "meta-llama/Llama-3.2-1B-Instruct" #'meta-llama/Llama-3.2-1B'#'google/gemma-2-2b-it'
llm_model_max_token_size: int = 32768
llm_model_max_async: int = 16
llm_model_kwargs: dict = field(default_factory=dict)
# storage
key_string_value_json_storage_cls: Type[BaseKVStorage] = JsonKVStorage
@@ -154,7 +155,7 @@ class LightRAG:
)
self.llm_model_func = limit_async_func_call(self.llm_model_max_async)(
partial(self.llm_model_func, hashing_kv=self.llm_response_cache)
partial(self.llm_model_func, hashing_kv=self.llm_response_cache, **self.llm_model_kwargs)
)
def insert(self, string_or_strings):