1 .修改了新建评估指标删除的bug
This commit is contained in:
@@ -116,7 +116,8 @@ def create_model_manage():
|
||||
'name': data.get('name'),
|
||||
'type': data.get('type'),
|
||||
'model_source': data.get('model_source', 'local'),
|
||||
'description': data.get('description')
|
||||
'description': data.get('description'),
|
||||
'purpose': data.get('purpose', 'inference') # 默认推理用途
|
||||
}
|
||||
|
||||
if data.get('model_source') == 'local':
|
||||
@@ -138,6 +139,17 @@ def update_model_manage(id):
|
||||
return jsonify({'code': 0, 'message': '更新成功'})
|
||||
|
||||
|
||||
@model_manage_bp.route('/<int:id>/purpose', methods=['PUT'])
|
||||
def update_model_purpose(id):
|
||||
"""更新模型用途"""
|
||||
data = request.json
|
||||
purpose = data.get('purpose')
|
||||
if purpose not in ['training', 'inference', 'evaluation']:
|
||||
return jsonify({'code': 1, 'message': '无效的用途类型'})
|
||||
generic_update('model_manage', id, {'purpose': purpose})
|
||||
return jsonify({'code': 0, 'message': '更新成功'})
|
||||
|
||||
|
||||
@model_manage_bp.route('/<int:id>', methods=['DELETE'])
|
||||
def delete_model_manage(id):
|
||||
"""删除模型"""
|
||||
|
||||
Reference in New Issue
Block a user