1
0
Fork 0
mirror of https://gitlab.com/niansa/libjustlm.git synced 2025-03-06 20:49:17 +01:00

Call llama_backend_init()/llama_backend_free()

This commit is contained in:
niansa 2023-08-31 16:56:10 +02:00
parent e3d52c42b7
commit 5d818e31aa
2 changed files with 11 additions and 2 deletions

View file

@ -347,10 +347,8 @@ public:
return get_state()->prompt;
}
#if LLAMA_DATE >= 230519
bool is_mirostat_available() const noexcept override {
return true;
}
#endif
};
}

View file

@ -30,3 +30,14 @@ LM::Inference *construct(const std::string &weights_path, std::ifstream& f, cons
return new LM::LLaMAInference(weights_path, p);
}
}
__attribute__((constructor))
static void init() {
llama_backend_init(true);
}
__attribute__((destructor))
static void deinit() {
llama_backend_free();
}