Skip to content

Commit 0225ab4

Browse files
committed
feat: add == operator for params
1 parent 1896c73 commit 0225ab4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

code/ac/llama/Model.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class AC_LLAMA_EXPORT Model {
2424
bool gpu = true; // try to load data on gpu
2525
bool vocabOnly = false; // do not load model, only vocab
2626
bool prefixInputsWithBos = false; // add bos token to interactive inputs (#13)
27+
28+
bool operator==(const Params& other) const noexcept {
29+
return gpu == other.gpu
30+
&& vocabOnly == other.vocabOnly
31+
&& prefixInputsWithBos == other.prefixInputsWithBos;
32+
}
2733
};
2834

2935
Model(std::shared_ptr<llama_model> model, Params params);
@@ -78,9 +84,7 @@ class AC_LLAMA_EXPORT ModelRegistry {
7884

7985
bool operator==(const ModelKey& other) const noexcept {
8086
return gguf == other.gguf
81-
&& params.gpu == other.params.gpu
82-
&& params.prefixInputsWithBos == other.params.prefixInputsWithBos
83-
&& params.vocabOnly == other.params.vocabOnly;
87+
&& params == other.params;
8488
}
8589
};
8690

0 commit comments

Comments
 (0)