File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Original file line number Diff line number Diff line change 15
15
// TODO: move somewhere else
16
16
#define QK 32
17
17
18
+ // Define std::make_unique if it's not available
19
+ // (e.g. on C++11)
20
+ #ifndef __cpp_lib_make_unique
21
+ template <typename T, typename ... Args>
22
+ std::unique_ptr<T> make_unique (Args&&... args) {
23
+ return std::unique_ptr<T>(new T (std::forward<Args>(args)...));
24
+ }
25
+ #else
26
+ using std::make_unique;
27
+ #endif
28
+
18
29
// determine number of model parts based on the dimension
19
30
static const std::map<int , int > LLAMA_N_PARTS = {
20
31
{ 4096 , 1 },
@@ -106,7 +117,7 @@ struct llama_context
106
117
model (std::move(model)),
107
118
vocab (std::move(vocab)),
108
119
params (params),
109
- state (std:: make_unique<llama_state>())
120
+ state (make_unique<llama_state>())
110
121
{
111
122
}
112
123
~llama_context (){
You can’t perform that action at this time.
0 commit comments