Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const options = {
// do not pass the job ID to Genie, otherwise the lines will be prefixed twice
backend: 'decanlp',
locale: task.language,
config: genieConfig,
thingpediaUrl: Url.resolve(Config.SERVER_ORIGIN, Config.THINGPEDIA_URL),
debug: true,
workdir,
datadir,
outputdir
};
const genieJob = Genie.Training.createJob(options);
genieJob.on('progress', async (value) => {
task.setProgress(value);
if (hasRemoteTensorboardDir) {
await AbstractFS.sync(workdir, tensorboardDir,
'--exclude=*', '--include=*tfevents*');
}
});
task.on('killed', () => {
genieJob.kill();
});
await genieJob.train();
if (!task.killed) {
await AbstractFS.upload(outputdir, AbstractFS.resolve(task.jobDir, 'output'));
await AbstractFS.removeTemporary(jobdir);
async _train() {
this._genieJob = Genie.Training.createJob(this._options);
this._genieJob.on('progress', (value) => {
this._send('progress', value);
});
await this._genieJob.train();
}