Skip to content

Commit dd264e7

Browse files
committed
add with_main_gpu to LlamaModelParams
This commit adds a `with_main_gpu` method to `LlamaModelParams` which allows the main GPU to be set. Signed-off-by: Daniel Bevenius <[email protected]>
1 parent 52687ca commit dd264e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llama-cpp-2/src/model/params.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ impl LlamaModelParams {
5656
self
5757
}
5858

59+
/// sets the main GPU
60+
#[must_use]
61+
pub fn with_main_gpu(mut self, main_gpu: i32) -> Self {
62+
self.params.main_gpu = main_gpu;
63+
self
64+
}
65+
5966
/// sets `vocab_only`
6067
#[must_use]
6168
pub fn with_vocab_only(mut self, vocab_only: bool) -> Self {

0 commit comments

Comments
 (0)