From eef5d4b779cb2455088ae34b6f11cdaa4874b9cf Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 12 Jul 2024 16:36:11 +0800 Subject: [PATCH] fix ollama max token issue --- api/db/services/dialog_service.py | 2 +- api/ragflow_server.py | 2 +- graph/component/base.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index 86f5f5ab96..b4c42acf78 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -80,7 +80,7 @@ def chat(dialog, messages, stream=True, **kwargs): llm = TenantLLMService.query(tenant_id=dialog.tenant_id, llm_name=dialog.llm_id) if not llm: raise LookupError("LLM(%s) not found" % dialog.llm_id) - max_tokens = 1024 + max_tokens = 8192 else: max_tokens = llm[0].max_tokens kbs = KnowledgebaseService.get_by_ids(dialog.kb_ids) diff --git a/api/ragflow_server.py b/api/ragflow_server.py index 8878817a34..a4e5b77154 100644 --- a/api/ragflow_server.py +++ b/api/ragflow_server.py @@ -94,7 +94,7 @@ def update_progress(): werkzeug_logger = logging.getLogger("werkzeug") for h in access_logger.handlers: werkzeug_logger.addHandler(h) - run_simple(hostname=HOST, port=HTTP_PORT, application=app, threaded=True, use_reloader=RuntimeConfig.DEBUG, use_debugger=RuntimeConfig.DEBUG) + run_simple(hostname=HOST, port=HTTP_PORT, application=app, processes=5, use_reloader=RuntimeConfig.DEBUG, use_debugger=RuntimeConfig.DEBUG) except Exception: traceback.print_exc() os.kill(os.getpid(), signal.SIGKILL) \ No newline at end of file diff --git a/graph/component/base.py b/graph/component/base.py index 13364fde7d..7c0b42e1ed 100644 --- a/graph/component/base.py +++ b/graph/component/base.py @@ -35,7 +35,7 @@ class ComponentParamBase(ABC): def __init__(self): self.output_var_name = "output" - self.message_history_window_size = 4 + self.message_history_window_size = 22 def set_name(self, name: str): self._name = name