Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions apps/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,15 +604,6 @@ function runPredict(key) {
}
}

// Function to check if model name is repeated or not.
function checkNameDuplicate(name) {
if (nameArray.indexOf(name)!=-1) {
return 1;
}
return 0;
}


// TO-DO: Allow uploading and using tensorflow graph models. Can't save graph models. Need to use right away.
function uploadModel() {
var _name = document.querySelector('#name');
Expand Down Expand Up @@ -697,17 +688,6 @@ function uploadModel() {
return;
}

try {
if (checkNameDuplicate(_name.value)) {
throw new Error('Model name repeated');
}
} catch (e) {
status.innerHTML = 'Model with the same name already exists. Please choose a new name';
status.classList.remove('blink');
return;
}
nameArray.push(_name.value);

await model.save(IDB_URL + name);

// Update the model store db entry to have the classes array
Expand All @@ -724,6 +704,7 @@ function uploadModel() {
console.log('SUCCESS, ID:', e.target.result);
status.innerHTML = 'Done! Click refresh below.';
status.classList.remove('blink');
modelName.push(_name.value);
};
req.onerror = function(e) {
status.innerHTML = 'Some error this way!';
Expand Down
1 change: 1 addition & 0 deletions apps/segment/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ function uploadModel() {
console.log('SUCCESS, ID:', e.target.result);
status.innerHTML = 'Done! Click refresh below.';
status.classList.remove('blink');
modelName.push(_name.value);
};
req.onerror = function(e) {
status.innerHTML = 'Some error this way!';
Expand Down