app.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:corpus-to-graph-ml 作者: CatalystCode 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号