当前位置: 首页 > ai >正文

llamafactory-cli webui启动报错TypeError: argument of type ‘bool‘ is not iterable

一、问题

在阿里云NoteBook上启动llamafactory-cli webui报错TypeError: argument of type ‘bool’ is not iterable

This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)
ERROR:    Exception in ASGI application
Traceback (most recent call last):File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgiresult = await app(  # type: ignore[func-returns-value]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__return await self.app(scope, receive, send)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__await super().__call__(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__await self.middleware_stack(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__raise excFile "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__await self.app(scope, receive, _send)File "/usr/local/lib/python3.11/site-packages/gradio/route_utils.py", line 789, in __call__await self.app(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_appraise excFile "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_appawait app(scope, receive, sender)File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__await self.middleware_stack(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 734, in appawait route.handle(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handleawait self.app(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in appawait wrap_app_handling_exceptions(app, request)(scope, receive, send)File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_appraise excFile "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_appawait app(scope, receive, sender)File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in appresponse = await f(request)^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in appraw_response = await run_endpoint_function(^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 214, in run_endpoint_functionreturn await run_in_threadpool(dependant.call, **values)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 37, in run_in_threadpoolreturn await anyio.to_thread.run_sync(func)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_syncreturn await get_async_backend().run_sync_in_worker_thread(^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_threadreturn await future^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 967, in runresult = context.run(func, *args)^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio/routes.py", line 584, in maingradio_api_info = api_info(request)^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio/routes.py", line 615, in api_infoapi_info = utils.safe_deepcopy(app.get_blocks().get_api_info())^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio/blocks.py", line 3019, in get_api_infopython_type = client_utils.json_schema_to_python_type(info)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 931, in json_schema_to_python_typetype_ = _json_schema_to_python_type(schema, schema.get("$defs"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 976, in _json_schema_to_python_typeelements = _json_schema_to_python_type(items, defs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 946, in _json_schema_to_python_typereturn _json_schema_to_python_type(defs[schema["$ref"].split("/")[-1]], defs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 985, in _json_schema_to_python_typedes = [^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 986, in <listcomp>f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 998, in _json_schema_to_python_typedesc = " | ".join([_json_schema_to_python_type(i, defs) for i in schema[type_]])^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 998, in <listcomp>desc = " | ".join([_json_schema_to_python_type(i, defs) for i in schema[type_]])^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 946, in _json_schema_to_python_typereturn _json_schema_to_python_type(defs[schema["$ref"].split("/")[-1]], defs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 985, in _json_schema_to_python_typedes = [^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 986, in <listcomp>f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 993, in _json_schema_to_python_typef"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 939, in _json_schema_to_python_typetype_ = get_type(schema)^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/gradio_client/utils.py", line 898, in get_typeif "const" in schema:^^^^^^^^^^^^^^^^^
TypeError: argument of type 'bool' is not iterable
...
二、问题解决

pydantic版本回退到: 2.10.6

pip uninstall pydantic
pip install pydantic==2.10.6

重新启动llamafactory-cli webui,能够正常通过浏览器打开webui
在这里插入图片描述
在这里插入图片描述



参考:
https://juejin.cn/post/7490524670082449471

http://www.xdnf.cn/news/3300.html

相关文章:

  • 《AI大模型应知应会100篇》第41篇:多轮对话设计:构建高效的交互式应用
  • CentOS 7 下安装 supervisor-3.4.0-1.el7.noarch.rpm 详细步骤
  • QMK固件开发指南:构建您的第一个固件
  • 22.2Linux的I2C驱动实验(编程)_csdn
  • 2024年12月 C/C++(二级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • Qt指南针
  • 9. 深入Spring AI:刨析 ChatMemory
  • 从MCP基础到FastMCP实战应用
  • 攻防世界 - Web - Level 4 | Confusion1
  • qemu学习笔记:QOM
  • AWS CloudFront全球加速利器:解析出海业务的核心优势与最佳实践
  • 2025五一数学建模ABC题选题建议,思路模型分析
  • Hive数据倾斜 常见解决办法
  • 深度学习框架搭建(Vscode/Anaconda/CUDA/Pytroch)
  • 基于单片机的音频信号处理系统设计(三)
  • LangChain简明教程(12)
  • Ubuntu 安装 Cursor
  • donet使用指定版本sdk
  • Python数据分析课程实验-2
  • C#类访问修饰符
  • 经济学和奥地利学派的起源
  • WEB UI自动化测试之Selenium框架学习
  • 面试中系统化地解答系统设计题:通用方法论
  • Unity图片导入设置
  • C++11新特性_范围-based for 循环
  • 五一北方穿外套:南方要防暑
  • 33、VS中提示“以下文件中的行尾不一致。是否将行尾标准化?“是什么意思?
  • SpringBoot使用分组校验解决同一个实体对象在不同场景下需要不同校验规则的问题
  • [更新完毕]2025东三省A题深圳杯A题数学建模挑战赛数模思路代码文章教学:热弹性物理参数估计
  • 5月1日日记