Kevin Hu
commited on
Commit
·
c832019
1
Parent(s):
fd69a6c
fix ollama max token issue (#1489)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- api/db/services/dialog_service.py +1 -1
- api/ragflow_server.py +1 -1
- graph/component/base.py +1 -1
api/db/services/dialog_service.py
CHANGED
|
@@ -80,7 +80,7 @@ def chat(dialog, messages, stream=True, **kwargs):
|
|
| 80 |
llm = TenantLLMService.query(tenant_id=dialog.tenant_id, llm_name=dialog.llm_id)
|
| 81 |
if not llm:
|
| 82 |
raise LookupError("LLM(%s) not found" % dialog.llm_id)
|
| 83 |
-
max_tokens =
|
| 84 |
else:
|
| 85 |
max_tokens = llm[0].max_tokens
|
| 86 |
kbs = KnowledgebaseService.get_by_ids(dialog.kb_ids)
|
|
|
|
| 80 |
llm = TenantLLMService.query(tenant_id=dialog.tenant_id, llm_name=dialog.llm_id)
|
| 81 |
if not llm:
|
| 82 |
raise LookupError("LLM(%s) not found" % dialog.llm_id)
|
| 83 |
+
max_tokens = 8192
|
| 84 |
else:
|
| 85 |
max_tokens = llm[0].max_tokens
|
| 86 |
kbs = KnowledgebaseService.get_by_ids(dialog.kb_ids)
|
api/ragflow_server.py
CHANGED
|
@@ -94,7 +94,7 @@ if __name__ == '__main__':
|
|
| 94 |
werkzeug_logger = logging.getLogger("werkzeug")
|
| 95 |
for h in access_logger.handlers:
|
| 96 |
werkzeug_logger.addHandler(h)
|
| 97 |
-
run_simple(hostname=HOST, port=HTTP_PORT, application=app,
|
| 98 |
except Exception:
|
| 99 |
traceback.print_exc()
|
| 100 |
os.kill(os.getpid(), signal.SIGKILL)
|
|
|
|
| 94 |
werkzeug_logger = logging.getLogger("werkzeug")
|
| 95 |
for h in access_logger.handlers:
|
| 96 |
werkzeug_logger.addHandler(h)
|
| 97 |
+
run_simple(hostname=HOST, port=HTTP_PORT, application=app, processes=5, use_reloader=RuntimeConfig.DEBUG, use_debugger=RuntimeConfig.DEBUG)
|
| 98 |
except Exception:
|
| 99 |
traceback.print_exc()
|
| 100 |
os.kill(os.getpid(), signal.SIGKILL)
|
graph/component/base.py
CHANGED
|
@@ -35,7 +35,7 @@ _IS_RAW_CONF = "_is_raw_conf"
|
|
| 35 |
class ComponentParamBase(ABC):
|
| 36 |
def __init__(self):
|
| 37 |
self.output_var_name = "output"
|
| 38 |
-
self.message_history_window_size =
|
| 39 |
|
| 40 |
def set_name(self, name: str):
|
| 41 |
self._name = name
|
|
|
|
| 35 |
class ComponentParamBase(ABC):
|
| 36 |
def __init__(self):
|
| 37 |
self.output_var_name = "output"
|
| 38 |
+
self.message_history_window_size = 22
|
| 39 |
|
| 40 |
def set_name(self, name: str):
|
| 41 |
self._name = name
|