GaiZhenbiao / ChuanhuChatGPT

GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.
https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT
GNU General Public License v3.0
15.25k stars 2.3k forks source link

[Docker]: 构建失败ImportError: cannot import name 'lower_char' #1165

Closed BigDataMao closed 1 month ago

BigDataMao commented 1 month ago

是否已存在现有反馈与解答?

是否是一个代理配置相关的疑问?

错误描述

docker建构失败 具体报错 Traceback (most recent call last):

File "/app/ChuanhuChatbot.py", line 12, in

from modules.overwrites import patch_gradio

File "/app/modules/overwrites.py", line 5, in

from multipart.multipart import MultipartState, CR, LF, HYPHEN, COLON, lower_char, LOWER_A, LOWER_Z, SPACE, FLAG_PART_BOUNDARY, FLAG_LAST_BOUNDARY, join_bytes

ImportError: cannot import name 'lower_char' from 'multipart.multipart' (/root/.local/lib/python3.10/site-packages/multipart/multipart.py)

复现操作

在zeabur.com上自动构建会出现这个问题

错误日志

No response

运行环境

补充说明

No response

BigDataMao commented 1 month ago

已复查,不是dockerfile问题,是main分支代码问题

GaiZhenbiao commented 1 month ago

我看看

BigDataMao commented 1 month ago

python-multipart==0.0.9可以解决此问题 但似乎还有其他问题 raise PydanticSchemaGenerationError( pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set arbitrary_types_allowed=True in the model_config to ignore this error or implement __get_pydantic_core_schema__ on your type to fully support it.

GaiZhenbiao commented 1 month ago

安装下面版本的pydantic呢? openapi-schema-pydantic 1.2.4 pydantic 2.5.2 pydantic_core 2.14.5

BigDataMao commented 1 month ago

我这边尝试结果是无效 raise mapped_exc(message) from exc httpx.ConnectTimeout: timed out

GaiZhenbiao commented 1 month ago

是httpx的版本问题吗? 安装 httpx==0.25.2 试试?

BigDataMao commented 1 month ago

安装好后回到前面的问题 pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set arbitrary_types_allowed=True in the model_config to ignore this error or implement __get_pydantic_core_schema__ on your type to fully support it.

If you got this error by calling handler() within __get_pydantic_core_schema__ then you likely need to call handler.generate_schema(<some type>) since we do not call __get_pydantic_core_schema__ on <some type> otherwise to avoid infinite recursion.

BigDataMao commented 1 month ago

gradio==4.26.0 gradio_client==0.15.1 primp==0.5.5 pypinyin tiktoken socksio tqdm colorama googlesearch-python Pygments openai==1.16.2 langchain==0.1.14 langchain-openai langchainhub langchain_community groq markdown PyPDF2 pdfplumber pandas commentjson openpyxl pandoc wolframalpha faiss-cpu==1.7.4 duckduckgo-search>=5.3.0 arxiv wikipedia google-cloud-aiplatform google.generativeai unstructured google-api-python-client tabulate ujson python-docx websocket_client pydantic==2.5.2 google-search-results anthropic==0.18.1 Pillow>=10.1.0 protobuf==3.20.3 ollama>=0.1.6 numexpr regex python-multipart==0.0.9 openapi-schema-pydantic==1.2.4 pydantic==2.5.2 pydantic_core==2.14.5 httpx==0.25.2

GaiZhenbiao commented 1 month ago

你是自己写的dockerfile吗,不妨试试我们写的。我怀疑是python版本不对引起的。

BigDataMao commented 1 month ago

不是我的DockerFile, 现在也不是构建DockerFile的问题,本地运行也报错. python用的3.10 俺不信你那儿平稳运行......^^

Keldos-Li commented 1 month ago

我们这儿运行都正常呐。。

BigDataMao commented 1 month ago

我回滚到历史上正常的版本,依然报错. 所以锁定了requirements里面未指定版本号的包,在安装的时候安装了最高版本导致的问题

BigDataMao commented 1 month ago

您方便的话吧你运行正常的软件包版本发给我(不是requirements)

BigDataMao commented 1 month ago

已修复问题. 另外请问,为何配置文件不能配置Claude的baseurl,是官方不支持吗. 我试过,可以直接写key,但是就变成直连Claude了,IP风险太大 @GaiZhenbiao