Comments (5)
Hi! Would you be able to show me what comes up in terminal when you run it?
Also, if you wish to trouble shoot yourself
import { spawn } from 'child_process';
import { EventEmitter } from 'events';
class GPT4ALL extends EventEmitter {
status = 0;
buffer = "";
constructor(app) {
super();
this.chat = spawn(app);
this.chat.stdout.on('data', (data) => {
let str = data.toString();
if (str.includes("\x1b[33m")) {
this.status = 1;
this.emit("ready");
this.buffer = "";
} else if (str.includes(">")) {
this.emit("data", this.buffer);
this.buffer = "";
} else {
this.buffer += str;
}
});
this.chat.on('exit', (code) => { console.error(`${code}`);
}
async ask(msg) {
if (!this.status) return null;
this.chat.stdin.write(`${msg}\n`);
return new Promise(resolve => this.once("data", resolve));
}
}
export default GPT4ALL;
here is a version of the gpt4all wrapper that includes error handling (which will be hopefully re-added to the official release)
from gpt4all-api.
It just says that the express server is running
also there was a small error in the error handling wrapper
this.chat.on('exit', (code) => { console.error(`${code}`); //doesnt work
this.chat.on('exit', (code) => { console.error(`${code}`) }); //works
edit: I ran it with the error handling and it seems like gpt just exits with error code 1
edit 2: also dont you need to specify the model path when launching the .exe ?
from gpt4all-api.
after a little more debugging than i would like to admit i figured out that the model was corrupted, I redownloaded it from the original gpt4all repository and it works now.
Nvm i only got it to work in command prompt but the sdk still does the same thing
from gpt4all-api.
Can you show what you mean by working in command prompt?
from gpt4all-api.
it works when I run it from command prompt
But it still doesnt work with the library
from gpt4all-api.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpt4all-api.