Added files field to model info
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -57,13 +57,13 @@ class CNNView(FlaskView):
|
||||
|
||||
return jsonify(self.aimodel_schema.dump(m)), 200
|
||||
|
||||
def delete(self, _id: str):
|
||||
def delete(self, id_: str):
|
||||
|
||||
if _id == "$default":
|
||||
if id_ == "$default":
|
||||
default = Default.query.filter_by(type=AIModelType.cnn).first_or_404()
|
||||
m = default.aimodel
|
||||
else:
|
||||
m = AIModel.query.filter_by(type=AIModelType.cnn, id=_id).first_or_404()
|
||||
m = AIModel.query.filter_by(type=AIModelType.cnn, id=id_).first_or_404()
|
||||
|
||||
storage.connection.remove_object(current_app.config['MINIO_CNN_BUCKET_NAME'], "weights/" + str(m.id))
|
||||
storage.connection.remove_object(current_app.config['MINIO_CNN_BUCKET_NAME'], "model/" + str(m.id))
|
||||
@@ -73,14 +73,14 @@ class CNNView(FlaskView):
|
||||
|
||||
return '', 204
|
||||
|
||||
@route('<_id>/file')
|
||||
def get_file(self, _id: str):
|
||||
@route('<id_>/file')
|
||||
def get_file(self, id_: str):
|
||||
|
||||
if _id == "$default":
|
||||
if id_ == "$default":
|
||||
default = Default.query.filter_by(type=AIModelType.cnn).first_or_404()
|
||||
m = default.aimodel
|
||||
else:
|
||||
m = AIModel.query.filter_by(type=AIModelType.cnn, id=_id).first_or_404()
|
||||
m = AIModel.query.filter_by(type=AIModelType.cnn, id=id_).first_or_404()
|
||||
|
||||
if "weights" in request.args:
|
||||
path = "weights/" + str(m.id)
|
||||
|
||||
Reference in New Issue
Block a user