mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-05 03:27:09 +00:00
Refactor(typescript)/error handling (#1283)
* actually display error if it occurs while instantiating * bump version
This commit is contained in:
parent
9100b2ef6f
commit
0e866a0e8f
@ -58,10 +58,13 @@ Napi::Function NodeModelWrapper::GetClass(Napi::Env env) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
llmodel_set_implementation_search_path(library_path.c_str());
|
llmodel_set_implementation_search_path(library_path.c_str());
|
||||||
llmodel_error* e = nullptr;
|
llmodel_error e = {
|
||||||
inference_ = std::make_shared<llmodel_model>(llmodel_model_create2(full_weight_path.c_str(), "auto", e));
|
.message="looks good to me",
|
||||||
if(e != nullptr) {
|
.code=0,
|
||||||
Napi::Error::New(env, e->message).ThrowAsJavaScriptException();
|
};
|
||||||
|
inference_ = std::make_shared<llmodel_model>(llmodel_model_create2(full_weight_path.c_str(), "auto", &e));
|
||||||
|
if(e.code != 0) {
|
||||||
|
Napi::Error::New(env, e.message).ThrowAsJavaScriptException();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(GetInference() == nullptr) {
|
if(GetInference() == nullptr) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gpt4all",
|
"name": "gpt4all",
|
||||||
"version": "2.1.0-alpha",
|
"version": "2.1.1-alpha",
|
||||||
"packageManager": "yarn@3.6.1",
|
"packageManager": "yarn@3.6.1",
|
||||||
"main": "src/gpt4all.js",
|
"main": "src/gpt4all.js",
|
||||||
"repository": "nomic-ai/gpt4all",
|
"repository": "nomic-ai/gpt4all",
|
||||||
|
Loading…
Reference in New Issue
Block a user