chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
31.75k stars 5.54k forks source link

ValueError: Tag "<|endoftext|>" does not correspond to any known color directive, make sure you did not misspelled it (or prepend '\' to escape it) #4516

Closed Modas-Li closed 1 month ago

Modas-Li commented 3 months ago

INFO: 127.0.0.1:37464 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi result = await app( # type: ignore[func-returns-value] File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in call return await self.app(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/routing.py", line 758, in call await self.middleware_stack(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/routing.py", line 778, in app await route.handle(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/routing.py", line 299, in handle await self.app(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/routing.py", line 79, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/starlette/routing.py", line 74, in app response = await func(request) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/fastapi/routing.py", line 299, in app raise e File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(*values) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/chatchat/server/api_server/openai_routes.py", line 145, in create_chat_completions logger.debug(body) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/chatchat/utils.py", line 38, in debug _debug(args, **kwds) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/loguru/_logger.py", line 2040, in debug self._log("DEBUG", False, __self._options, message, args, kwargs) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/loguru/_logger.py", line 2017, in _log colored_message = Colorizer.prepare_simple_message(str(message)) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/loguru/_colorizer.py", line 368, in prepare_simple_message parser.feed(string) File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/loguru/_colorizer.py", line 252, in feed raise ValueError( ValueError: Tag "<|endoftext|>" does not correspond to any known color directive, make sure you did not misspelled it (or prepend '\' to escape it) 2024-07-15 11:37:46,817 httpx 36906 INFO HTTP Request: POST http://127.0.0.1:7860/v1/chat/completions "HTTP/1.1 500 Internal Server Error" 2024-07-15 11:37:46,817 openai._base_client 36906 INFO Retrying request to /chat/completions in 0.812822 seconds

Modas-Li commented 3 months ago

使用qwen2-instruct

zx1159652666 commented 3 months ago

请问解决了吗

liunux4odoo commented 3 months ago

这个报错是 logger 里颜色标记错误。你可以把下面这句注释掉试试:

File "/data/anaconda3/envs/chatchat/lib/python3.10/site-packages/chatchat/server/api_server/openai_routes.py", line 145, in create_chat_completions
logger.debug(body)
github-actions[bot] commented 2 months ago

这个问题已经被标记为 stale ,因为它已经超过 30 天没有任何活动。