diff --git a/evaluate_server.py b/evaluate_server.py index aff29c1..5d771c4 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -31,7 +31,7 @@ def upload(): if type not in ['lite_resnet', 'lite_vanilla', 'legacy_vanilla', 'lite_unified']: return jsonify({'status': -1, 'message': 'illegal type'}) position = request.form.get("position") - if position not in positions: + if position != 'uni' and position not in positions: return jsonify({'status': -2, 'message': 'illegal position'}) frame = int(request.form.get("frame")) model_file = request.files.get('model_file') @@ -42,7 +42,11 @@ def upload(): if model is None: model_file.save(path) Model.create(path=path, position=position,type=type,frame=frame,create_time=datetime.now()) - Battle.create(challenger_path=path, challenger_position=position, status=0) + if position == 'uni': + for position in positions: + Battle.create(challenger_path=path, challenger_position=position, status=0) + else: + Battle.create(challenger_path=path, challenger_position=position, status=0) return jsonify({'status': 0, 'message': 'success', 'result': ''}) def start_runner(flags):