def get_backup():
experiment = request.args.get('xp')
try:
experiment = to_unicode(experiment)
except:
return wrong_argument("Experiment name should be a non-empty string or unicode instead of '{}'".format(type(experiment)))
if not experiment:
return wrong_argument("xp argument is required")
folder_path = tensorboard_folder.format(experiment)
if not path.isdir(folder_path):
return wrong_argument("Requested experiment '{}' does not exist".format(experiment))
zip_file = shutil.make_archive("/tmp/{}".format(experiment), 'zip', folder_path)
return send_file(zip_file, mimetype='application/zip')
评论列表
文章目录