How to use the genie-toolkit.Predictor 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 / evaluate.js View on Github external
constructor(modeldir, locale) {
        this._locale = locale;
        this._tokenizer = TokenizerService.getLocal();
        this._predictor = new Genie.Predictor('local', modeldir, 1);
    }
github stanford-oval / almond-cloud / nlp / nlp_model.js View on Github external
async load() {
        if (!this.trained)
            return;

        await this._download();
        this.predictor = new Genie.Predictor(this.id, this._localdir, nprocesses);
        await this.predictor.start();
    }
};
github stanford-oval / almond-cloud / nlp / nlp_model.js View on Github external
async reload() {
        if (!this.trained)
            return;

        const oldlocaldir = this._localdir;
        await this._download();

        const oldpredictor = this.predictor;
        this.predictor = new Genie.Predictor(this.id, this._localdir, nprocesses);
        await this.predictor.start();

        await Promise.all([
            oldpredictor ? oldpredictor.stop() : Promise.resolve(),
            oldlocaldir ? AbstractFS.removeTemporary(oldlocaldir) : Promise.resolve()
        ]);
    }