http请求示例

def query_tf_serving(url, data, request_time, num=1):
"""
请求模型服务接口
Args:
url: 请求url
data: 请求数据,image base64字符串
request_time: 请求时间
num: 请求次数,最多重试5次

Returns:
分类模型预测值

"""
logger.info(f"The {num} query to tensorflow serving. URL: {url}. request_time: {str(request_time)}")

if num >= 5:
raise Exception(f"Query tensorflow serving retry over 5 times.")

header = {
'user-agent': logTag.x_call_id,
"C

http请求示例最先出现在Python成神之路

版权声明:
作者:siwei
链接:https://www.techfm.club/p/21812.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>