Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

连续问问题会导致崩溃

Open Yamol opened this issue 1 year ago • 4 comments

看上去不是爆内存的问题,连续问问题后,会出现如下报错

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/devops/git/langchain-ChatGLM/knowledge_based_chatglm.py:118 in <module>                    │
│                                                                                                  │
│   115 │   │   vector_store = init_knowledge_vector_store(filepath)                               │
│   116 │   history = []                                                                           │
│   117 │   while True:                                                                            │
│ ❱ 118 │   │   query = input("Input your question 请输入问题:")                                  │
│   119 │   │   resp, history = get_knowledge_based_answer(query=query,                            │
│   120 │   │   │   │   │   │   │   │   │   │   │   │      vector_store=vector_store,              │
│   121 │   │   │   │   │   │   │   │   │   │   │   │      chat_history=history)                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 21: invalid continuation byte

Yamol avatar Apr 13 '23 13:04 Yamol

请问是提问中包含退格了吗

Yingxiang @.***>于2023年4月13日 周四21:30写道:

看上去不是爆内存的问题,连续问问题后,会出现如下报错

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/devops/git/langchain-ChatGLM/knowledge_based_chatglm.py:118 in │ │ │ │ 115 │ │ vector_store = init_knowledge_vector_store(filepath) │ │ 116 │ history = [] │ │ 117 │ while True: │ │ ❱ 118 │ │ query = input("Input your question 请输入问题:") │ │ 119 │ │ resp, history = get_knowledge_based_answer(query=query, │ │ 120 │ │ │ │ │ │ │ │ │ │ │ │ vector_store=vector_store, │ │ 121 │ │ │ │ │ │ │ │ │ │ │ │ chat_history=history) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 21: invalid continuation byte

— Reply to this email directly, view it on GitHub https://github.com/imClumsyPanda/langchain-ChatGLM/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

imClumsyPanda avatar Apr 13 '23 14:04 imClumsyPanda

请问是提问中包含退格了吗 Yingxiang @.>于2023年4月13日 周四21:30写道: 看上去不是爆内存的问题,连续问问题后,会出现如下报错 ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/devops/git/langchain-ChatGLM/knowledge_based_chatglm.py:118 in │ │ │ │ 115 │ │ vector_store = init_knowledge_vector_store(filepath) │ │ 116 │ history = [] │ │ 117 │ while True: │ │ ❱ 118 │ │ query = input("Input your question 请输入问题:") │ │ 119 │ │ resp, history = get_knowledge_based_answer(query=query, │ │ 120 │ │ │ │ │ │ │ │ │ │ │ │ vector_store=vector_store, │ │ 121 │ │ │ │ │ │ │ │ │ │ │ │ chat_history=history) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 21: invalid continuation byte — Reply to this email directly, view it on GitHub <#79>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM . You are receiving this because you are subscribed to this thread.Message ID: @.>

我翻了一下所有的 issue,确实是在输入问题时,写错了,然后退格键删除了再问。 这是个 bug 吗?能修复吗?

Yamol avatar Apr 14 '23 01:04 Yamol

目前在 macos 和 windows 环境下使用import readline的方式可以解决,ubuntu 暂未找到解决方式

Yingxiang @.***>于2023年4月14日 周五09:35写道:

请问是提问中包含退格了吗 Yingxiang @.

>于2023年4月13日 周四21:30写道: … <#m_-2893042901420782564_> 看上去不是爆内存的问题,连续问问题后,会出现如下报错 ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/devops/git/langchain-ChatGLM/knowledge_based_chatglm.py:118 in │ │ │ │ 115 │ │ vector_store = init_knowledge_vector_store(filepath) │ │ 116 │ history = [] │ │ 117 │ while True: │ │ ❱ 118 │ │ query = input("Input your question 请输入问题:") │ │ 119 │ │ resp, history = get_knowledge_based_answer(query=query, │ │ 120 │ │ │ │ │ │ │ │ │ │ │ │ vector_store=vector_store, │ │ 121 │ │ │ │ │ │ │ │ │ │ │ │ chat_history=history) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 21: invalid continuation byte — Reply to this email directly, view it on GitHub <#79 https://github.com/imClumsyPanda/langchain-ChatGLM/issues/79>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM . You are receiving this because you are subscribed to this thread.Message ID: @.>

我翻了一下所有的 issue,确实是在输入问题时,写错了,然后退格键删除了再问。 这是个 bug 吗?能修复吗?

— Reply to this email directly, view it on GitHub https://github.com/imClumsyPanda/langchain-ChatGLM/issues/79#issuecomment-1507807921, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EWWPHAFKZ2RBNZUOQTXBCSVLANCNFSM6AAAAAAW5C3RXM . You are receiving this because you commented.Message ID: @.***>

imClumsyPanda avatar Apr 14 '23 02:04 imClumsyPanda

Ubuntu 18.04 这个方法work

目前在 macos 和 windows 环境下使用import readline的方式可以解决,ubuntu 暂未找到解决方式 Yingxiang @.>于2023年4月14日 周五09:35写道: 请问是提问中包含退格了吗 Yingxiang @. >于2023年4月13日 周四21:30写道: … <#m_-2893042901420782564_> 看上去不是爆内存的问题,连续问问题后,会出现如下报错 ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/devops/git/langchain-ChatGLM/knowledge_based_chatglm.py:118 in │ │ │ │ 115 │ │ vector_store = init_knowledge_vector_store(filepath) │ │ 116 │ history = [] │ │ 117 │ while True: │ │ ❱ 118 │ │ query = input("Input your question 请输入问题:") │ │ 119 │ │ resp, history = get_knowledge_based_answer(query=query, │ │ 120 │ │ │ │ │ │ │ │ │ │ │ │ vector_store=vector_store, │ │ 121 │ │ │ │ │ │ │ │ │ │ │ │ chat_history=history) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 21: invalid continuation byte — Reply to this email directly, view it on GitHub <#79 <#79>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM https://github.com/notifications/unsubscribe-auth/ABLH5EVR32NGIQN4TSVR7NLXA75V3ANCNFSM6AAAAAAW5C3RXM . You are receiving this because you are subscribed to this thread.Message ID: @.> 我翻了一下所有的 issue,确实是在输入问题时,写错了,然后退格键删除了再问。 这是个 bug 吗?能修复吗? — Reply to this email directly, view it on GitHub <#79 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EWWPHAFKZ2RBNZUOQTXBCSVLANCNFSM6AAAAAAW5C3RXM . You are receiving this because you commented.Message ID: @.>

cifangyiquan avatar May 05 '23 12:05 cifangyiquan