Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c9904e5

Browse filesBrowse files
committed
Try fix for C++11
1 parent 1da3377 commit c9904e5
Copy full SHA for c9904e5

File tree

Expand file treeCollapse file tree

1 file changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-1
lines changed

‎llama.cpp

Copy file name to clipboardExpand all lines: llama.cpp
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
// TODO: move somewhere else
1616
#define QK 32
1717

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+
1829
// determine number of model parts based on the dimension
1930
static const std::map<int, int> LLAMA_N_PARTS = {
2031
{ 4096, 1 },
@@ -106,7 +117,7 @@ struct llama_context
106117
model(std::move(model)),
107118
vocab(std::move(vocab)),
108119
params(params),
109-
state(std::make_unique<llama_state>())
120+
state(make_unique<llama_state>())
110121
{
111122
}
112123
~llama_context(){

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.