How to use the genie-toolkit.Training function in genie-toolkit

To help you get started, we’ve selected a few genie-toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stanford-oval / almond-cloud / training / tasks / train.js View on Github external
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);
github stanford-oval / almond-cloud / training / gpu_training_daemon.js View on Github external
async _train() {
        this._genieJob = Genie.Training.createJob(this._options);
        this._genieJob.on('progress', (value) => {
            this._send('progress', value);
        });
        await this._genieJob.train();
    }