Closed x4080 closed 1 year ago
I resolve it using try catch
if (result.data.can_inference) {
result = await axios.get("http://127.0.0.1:8080/completion?stream=true", { responseType: 'stream' });
result.data.on('data', (data) => {
try {
let dat = JSON.parse(data.toString());
process.stdout.write(dat.content);
}
catch (err) {
console.log(data.toString());
}
// token by token completion
});
}
I haven't tried with other model, just with vicuna, it's a limitation of this implementation
I recommend you use this code:
result.data.on('data', (data) => {
// token by token completion
if(data.toString() != "[DONE]"){
let dat = JSON.parse(data.toString());
process.stdout.write(dat.content);
} else {
console.log("Completed");
}
});
}
Thanks
Hi again,
I tried to run the node and it works. But at the end there's error, here's the complete result :
I was using WizardLM-7B-uncensored.ggml.q4_2.bin
did I do something wrong ?
Thanks