mirror of https://github.com/google/gemma.cpp.git
Fix debug_prompt and other binaries (internal init)
PiperOrigin-RevId: 644367683
This commit is contained in:
parent
15135f5b3d
commit
70506b0a62
|
|
@ -86,15 +86,21 @@ GemmaEnv::GemmaEnv(const LoaderArgs& loader, const InferenceArgs& inference,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: the delegating ctor above is called before any other initializers here.
|
// Internal init must run before the GemmaEnv ctor above, hence it cannot occur
|
||||||
GemmaEnv::GemmaEnv(int argc, char** argv)
|
// in the argv ctor below because its body runs *after* the delegating ctor.
|
||||||
: GemmaEnv(LoaderArgs(argc, argv), InferenceArgs(argc, argv),
|
// This helper function takes care of the init, and could be applied to any of
|
||||||
AppArgs(argc, argv)) {
|
// the *Args classes, it does not matter which.
|
||||||
|
static AppArgs MakeAppArgs(int argc, char** argv) {
|
||||||
{ // So that indentation matches expectations.
|
{ // So that indentation matches expectations.
|
||||||
// Placeholder for internal init, do not modify.
|
// Placeholder for internal init, do not modify.
|
||||||
}
|
}
|
||||||
|
return AppArgs(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GemmaEnv::GemmaEnv(int argc, char** argv)
|
||||||
|
: GemmaEnv(LoaderArgs(argc, argv), InferenceArgs(argc, argv),
|
||||||
|
MakeAppArgs(argc, argv)) {}
|
||||||
|
|
||||||
std::pair<std::string, size_t> GemmaEnv::QueryModel(
|
std::pair<std::string, size_t> GemmaEnv::QueryModel(
|
||||||
const std::vector<int>& tokens) {
|
const std::vector<int>& tokens) {
|
||||||
std::string res;
|
std::string res;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue