Skip to content

Commit

Permalink
revert: feat: support load from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed May 14, 2024
1 parent 88323ad commit 9bb33a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/LlamaContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,10 @@ LlamaContext::LlamaContext(const Napi::CallbackInfo &info)
auto options = info[0].As<Napi::Object>();

gpt_params params;
auto model_uri = get_option<std::string>(options, "model", "");
if (model_uri.empty()) {
params.model = get_option<std::string>(options, "model", "");
if (params.model.empty()) {
Napi::TypeError::New(env, "Model is required").ThrowAsJavaScriptException();
}
if (model_uri.find("http://") == 0 || model_uri.find("https://") == 0) {
params.model_url = model_uri;
} else {
params.model = model_uri;
}
params.embedding = get_option<bool>(options, "embedding", false);
params.n_ctx = get_option<int32_t>(options, "n_ctx", 512);
params.n_batch = get_option<int32_t>(options, "n_batch", 2048);
Expand Down

0 comments on commit 9bb33a0

Please sign in to comment.