torchserve 接口调用报错TypeError: expected string or bytes-like object
接口 报错 string 调用 or object like TypeError
2023-09-11 14:14:27 时间
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
把数据打印出来就知道了,传入的是列表形式的字典,不是直接的字符串
curl -X POST http://localhost:8080/predictions/epidemic_hsy -d “data=牛牛牛牛牛女女”
data = text_s[0]
input_text = data.get("data")
if input_text is None:
input_text = data.get("body")
if isinstance(input_text, (bytes, bytearray)):
input_text = input_text.decode('utf-8')
相关文章
- DevOps on DevCloud|如何实现应用接口的混合驱动测试
- java多线程 -- 创建线程的第三者方式 实现Callable接口
- 对Java的接口和抽象类 的一些了解
- 经常使用的webservice接口
- 做接口测试的流程一般是怎么样的?阿里P7详谈
- 自动化接口测试JSON Schema断言应用
- 接口测试遇到500报错?别慌,你的头部可能有点问题
- 如何做好python接口自动化测试,不懂技术的测试改何去何从!
- WebService接口调用报错:Unable to create schema compiler,com.sun.tools.internal.xjc.api.XJC
- linux学习笔记 linux下I/O接口的演变之路
- 接口测试面试题小结