gradio dom.js异常处理

865次阅读
没有评论

共计 463 个字符,预计需要花费 2 分钟才能阅读完成。

gradio dom.js异常处理

今天在写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,今天顺利又水了一文,哇咔咔

正文完
请博主喝杯咖啡吧!
post-qrcode
 
admin
版权声明:本站原创文章,由 admin 2024-02-27发表,共计463字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码