Added checking of target class name is valid
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-10-01 21:30:41 +02:00
parent 9c189d1447
commit 0755d8453e
2 changed files with 6 additions and 3 deletions

View File

@ -61,9 +61,12 @@ class SVMView(FlaskView):
try:
_, _, _, _, mid_window, mid_step, short_window, short_step, compute_beat \
_, _, _, classes, mid_window, mid_step, short_window, short_step, compute_beat \
= load_model(temp_model_filename)
if info['target_class_name'] not in classes:
abort(400, f"This model does not have a class named {info['target_class_name']}")
# Because of pyAudiomeme the files already saved, so we just use the file uploader functions
storage.connection.fput_object(
current_app.config['MINIO_SVM_BUCKET_NAME'],