Skip to content

Commit ca510e5

Browse files
committed
keep fixing
1 parent ae5652c commit ca510e5

1 file changed

Lines changed: 0 additions & 70 deletions

File tree

  • services/language_translation

services/language_translation/v2.js

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ module.exports = function (RED) {
160160
text: 'model sent to training'
161161
});
162162
msg.payload = 'Model ' + model.name + ' successfully sent for training with id: ' + model.model_id;
163-
msg.id = model_id;
164163
node.send(msg);
165164
node.status({});
166165
}
@@ -169,66 +168,6 @@ module.exports = function (RED) {
169168
});
170169
}
171170

172-
this.doGetStatus = function(msg, trainid) {
173-
language_translation = watson.language_translation({
174-
username: username,
175-
password: password,
176-
version: 'v2'
177-
});
178-
179-
node.status({
180-
fill: 'blue',
181-
shape: 'dot',
182-
text: 'requesting status'
183-
});
184-
185-
language_translation.getModel({ model_id: trainid},
186-
function(err, model) {
187-
node.status({});
188-
if (err) {
189-
node.status({
190-
fill: 'red',
191-
shape: 'ring',
192-
text: 'call to translation service failed'
193-
});
194-
node.error(err, msg);
195-
} else {
196-
msg.payload = model.status;
197-
node.send(msg);
198-
node.status({});
199-
}
200-
}
201-
);
202-
}
203-
204-
this.doDelete = function(msg, trainid) {
205-
language_translation = watson.language_translation({
206-
username: username,
207-
password: password,
208-
version: 'v2'
209-
});
210-
211-
node.status({
212-
fill: 'blue',
213-
shape: 'dot',
214-
text: 'deleting'
215-
});
216-
217-
language_translation.deleteModel({ model_id:'{model_id}'},
218-
function(err) {
219-
node.status({});
220-
if (err) {
221-
node.status({
222-
fill: 'red',
223-
shape: 'ring',
224-
text: 'could not delete'
225-
});
226-
node.error(err, msg);
227-
}
228-
}
229-
);
230-
}
231-
232171
this.on('input', function (msg) {
233172
var message = '';
234173

@@ -278,9 +217,6 @@ module.exports = function (RED) {
278217
return;
279218
}
280219

281-
var trainid = msg.trainid || config.trainid;
282-
var basemodel = msg.basemodel || config.basemodel;
283-
284220
username = username || this.credentials.username;
285221
password = password || this.credentials.password;
286222

@@ -311,12 +247,6 @@ module.exports = function (RED) {
311247
case 'train':
312248
this.doTrain(msg, model_id, filetype);
313249
break;
314-
case 'getstatus':
315-
this.doGetStatus(msg, trainid);
316-
break;
317-
case 'delete':
318-
this.doDelete(msg, trainid);
319-
break;
320250
}
321251
});
322252
}

0 commit comments

Comments
 (0)