Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def visualize():
"""
Start netron with model from request.
Returns:
JSON response indicting success.
"""
if request.method == 'POST':
response_object = {'status': 'success'}
temp_model = request.files['file']
model_name = temp_model.filename
request.files['file'].save(model_name)
netron.start(model_name, browse=False, host='0.0.0.0')
return jsonify(response_object)