Skip to content

Commit 60a6186

Browse files
committed
fix3
1 parent 7b33029 commit 60a6186

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • services/language_translation

services/language_translation/v2.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,30 @@ module.exports = function (RED) {
112112
text: 'requesting training'
113113
});
114114

115-
temp.open({
116-
suffix: '.xml'
117-
}, function (err, info) {
115+
temp.open('myprefix', function (err, info) {
118116
if (!err) {
119117
fs.write(info.fd, msg.payload);
120118
var params = {};
121-
119+
console.log('filetype', filetype);
122120
switch (filetype) {
123121
case 'forcedglossary':
124122
params = {
125123
name: msg.filename.replace(/[^0-9a-z]/gi, ''),
126-
base_model_id: 'en-es',
124+
base_model_id: model_id,
127125
forced_glossary: fs.createReadStream(info.path)
128126
};
129127
break;
130128
case 'parallelcorpus':
131129
params = {
132130
name: msg.filename.replace(/[^0-9a-z]/gi, ''),
133-
base_model_id: 'en-es',
131+
base_model_id: model_id,
134132
parallel_corpus: fs.createReadStream(info.path)
135133
};
136134
break;
137135
case 'monolingualcorpus':
138136
params = {
139137
name: msg.filename.replace(/[^0-9a-z]/gi, ''),
140-
base_model_id: 'en-es',
138+
base_model_id: model_id,
141139
monolingual_corpus: fs.createReadStream(info.path)
142140
};
143141
break;
@@ -308,6 +306,7 @@ module.exports = function (RED) {
308306
model_id = srclang + '-' + destlang + '-' + domain;
309307
}
310308

309+
console.log('model id ', model_id);
311310
switch (action) {
312311
case 'translate':
313312
this.doTranslate(msg, model_id);

0 commit comments

Comments
 (0)