mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-11 05:19:31 +00:00
python: add list_gpus to the GPT4All API (#2194)
Other changes: * fix memory leak in llmodel_available_gpu_devices * drop model argument from llmodel_available_gpu_devices * breaking: make GPT4All/Embed4All arguments past model_name keyword-only Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
@@ -213,9 +213,9 @@ LLModel *LLModel::Implementation::constructDefaultLlama() {
|
||||
return llama.get();
|
||||
}
|
||||
|
||||
std::vector<LLModel::GPUDevice> LLModel::Implementation::availableGPUDevices() {
|
||||
std::vector<LLModel::GPUDevice> LLModel::Implementation::availableGPUDevices(size_t memoryRequired) {
|
||||
auto *llama = constructDefaultLlama();
|
||||
if (llama) { return llama->availableGPUDevices(0); }
|
||||
if (llama) { return llama->availableGPUDevices(memoryRequired); }
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user