({ upload: function(component, file, base64Data) { var action = component.get("c.predict"); var modelId = component.get("v.modelId"); action.setParams({ fileName: file.name, content: base64Data, modelId: modelId }); action.setCallback(this, function(a) { component.set("v.waiting", false); var state = a.getState(); if (state === 'ERROR') { console.log(a.getError()); alert("An error has occurred"); } var result = a.getReturnValue(); var predictions = []; if (result && result.length) { for (var i=0; i