HuggingFace下载模型后文本分类结果无法显示

背景:运行代码在huggingface下载roberta-base-finetuned-dianping-chinese模型之后,打开浏览器输入任何的中文input,文本分类结果都显示Error,以下是解决方案:

Hello World "Error" Output · Issue #4974 · gradio-app/gradio · GitHub中找到了这个留言:

I had the same error, but I downgraded the pydantic version from 2.2.1 to 1.10.7 and it worked fine. I changed the gradio version a lot, but it wasn't a version issue. I got it working fine with gradio==3.34.0.

大意:在gradio版本3.34.0不变的条件下,将环境里的pydantic包版本下调为1.10.7即可

亲测在gradio版本3.23.0将pydantic版本下降之后也可正常使用

pip install pydantic==1.10.7

 

  • 7
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值