IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    gradio dom.js异常处理

    admin发表于 2024-02-27 14:58:05
    love 0

    fXkJHL

    今天在写gradio代码的时候出现了下面这个错误

    dom.js:238 Uncaught (in promise) DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    

    相应的gradio 版本是4.16最新版,我的逻辑是radio组件联动chatbot组件,在radio组件中选择选项的时候,gradio出现卡死的现象,打开f12看到如上的错误。

    根本原因在于:输出到chatbot的内容包含了markdown table 语法,如果是纯文字没有问题

    在github上搜了下也有类似的问题,出现在3.50版本,这都4.16了好像还没修复。现在有两个方案:

    1. 继续保持原样,想要切换radio选项的时候先刷新页面,在做选择,但是这样交互很不友好
    2. 对gradio进行降级,目前试了3.40下使用无异常

      pip3 install gradio==3.40
      

    ok,今天顺利又水了一文,哇咔咔



沪ICP备19023445号-2号
友情链接