def update_model():
if request.headers['Content-Type'] != 'application/json':
resp = Response('Unssuported content type, expected application/json', status=500);
return resp
if (not request.json.has_key('path')):
resp = Response('Bad request: missing "path" field in JSON body', status=500);
return resp
path = request.json['path']
try:
scorer.load_model_from_url(path)
resp = Response("", status=200);
return resp
except Exception as e:
resp = Response("Internal Server Error: %s"%e, status = 500)
return resp
评论列表
文章目录