fix: trainAI not using the bin location

This commit is contained in:
GramingFoxTeam
2022-11-15 21:29:05 +03:00
parent 7f9ca77e03
commit bd2994388b
3 changed files with 3 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import HelperClient from '../../client/index.js';
const configJSON = readFileSync('../config.json', 'utf-8'); const configJSON = readFileSync('../config.json', 'utf-8');
const config = JSON.parse(configJSON); const config = JSON.parse(configJSON);
const helper = new HelperClient(config.server); const helper = new HelperClient(config);
helper.connect(); helper.connect();

View File

@@ -5,7 +5,7 @@ import EventEmitter from 'node:events';
class HelperClient extends EventEmitter { class HelperClient extends EventEmitter {
constructor({ server }) { constructor({ server }) {
super(); super();
if (!server.port) throw new Error('You did not specify the server port.'); if (!server?.port) throw new Error('You did not specify the server port.');
this.server = server; this.server = server;
}; };

View File

@@ -41,6 +41,7 @@ export default async function trainAI() {
}, },
serializeTo: join(global.__dirname, global.config.fasttext.loadModel).replace('.bin', ''), serializeTo: join(global.__dirname, global.config.fasttext.loadModel).replace('.bin', ''),
trainFile: join(global.__dirname, global.config.fasttext.trainFile), trainFile: join(global.__dirname, global.config.fasttext.trainFile),
bin: join(global.__dirname, global.config.fasttext.bin)
}); });
global.ft.unload(); global.ft.unload();