File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ bool LLModel::Implementation::isImplementation(const Dlhandle &dl) {
79
79
80
80
static bool s_scanned = false ;
81
81
82
- const std::vector<std::unique_ptr< LLModel::Implementation> > &LLModel::Implementation::implementationList () {
83
- static std::vector<std::unique_ptr< LLModel::Implementation> > s_impl_libs;
82
+ const std::vector<LLModel::Implementation> &LLModel::Implementation::implementationList () {
83
+ static std::vector<LLModel::Implementation> s_impl_libs;
84
84
85
85
if (s_scanned) { return s_impl_libs; }
86
86
std::string impl_name_re = " (bert|llama|gptj|llamamodel-mainline)" ;
@@ -109,7 +109,7 @@ const std::vector<std::unique_ptr<LLModel::Implementation>> &LLModel::Implementa
109
109
if (!Implementation::isImplementation (dl)) {
110
110
continue ;
111
111
}
112
- s_impl_libs.emplace_back (std::make_unique< Implementation> (std::move (dl)));
112
+ s_impl_libs.emplace_back (Implementation (std::move (dl)));
113
113
} catch (...) {}
114
114
}
115
115
}
@@ -122,9 +122,9 @@ const std::vector<std::unique_ptr<LLModel::Implementation>> &LLModel::Implementa
122
122
123
123
const LLModel::Implementation* LLModel::Implementation::implementation (const char *fname, const std::string& buildVariant) {
124
124
for (const auto & i : implementationList ()) {
125
- if (buildVariant != i-> m_buildVariant ) continue ;
126
- if (!i-> m_magicMatch (fname)) continue ;
127
- return i. get () ;
125
+ if (buildVariant != i. m_buildVariant ) continue ;
126
+ if (!i. m_magicMatch (fname)) continue ;
127
+ return &i ;
128
128
}
129
129
return nullptr ;
130
130
}
Original file line number Diff line number Diff line change 8
8
#include < fstream>
9
9
#include < cstdint>
10
10
#include < limits>
11
- #include < memory>
12
11
13
12
#define LLMODEL_MAX_PROMPT_BATCH 128
14
13
@@ -27,7 +26,7 @@ class LLModel {
27
26
std::string_view buildVariant () const { return m_buildVariant; }
28
27
29
28
static bool isImplementation (const Dlhandle&);
30
- static const std::vector<std::unique_ptr< Implementation> >& implementationList ();
29
+ static const std::vector<Implementation>& implementationList ();
31
30
static const Implementation *implementation (const char *fname, const std::string& buildVariant);
32
31
static LLModel *construct (const std::string &modelPath, std::string buildVariant = " auto" );
33
32
static void setImplementationsSearchPath (const std::string& path);
You can’t perform that action at this time.
0 commit comments