This was a whole lot easier to implement than the Temporal CNN I'm doing for my PhD..... Next task: tidy up the code, document it, and write the README ....that can wait until tomorrow though :Pmaster
parent
151d218102
commit
ab496d45de
@ -1,5 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
import FilmPredictor from '../../lib/FilmPredictor.mjs';
|
||||
|
||||
export default async function(settings) {
|
||||
if(!fs.existsSync(settings.input)) {
|
||||
console.error(`Error: The input file '${settings.input}' doesn't exist (did you type it correctly?)`);
|
||||
process.exit(1);
|
||||
}
|
||||
if(!fs.existsSync(settings.ai_model)) {
|
||||
console.error(`Error: Failed to locate AI model directory at '${settings.ai_model}'.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let model = new FilmPredictor(settings);
|
||||
await model.init(settings.ai_model); // We're training a new model here
|
||||
|
||||
let result = await model.predict(settings.input);
|
||||
console.log(result.join("\n"));
|
||||
}
|
||||
|
Loading…
Reference in new issue