Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model upload bug #360

Merged
merged 3 commits into from
Apr 13, 2020
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