From 4f8db44ae44f83e0f81b71a88b5d3d5fff4ccb6d Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Wed, 5 Jan 2022 11:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=84=E4=BC=B0BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evaluate_server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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):