mirror of https://github.com/google/gemma.cpp.git
Connect "--weights" parameter to Gemma
PiperOrigin-RevId: 617323257
This commit is contained in:
parent
fdc3812446
commit
6865819bb7
5
gemma.cc
5
gemma.cc
|
|
@ -839,11 +839,6 @@ Gemma::Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Gemma::Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
|
|
||||||
Model model_type, hwy::ThreadPool& pool)
|
|
||||||
: Gemma(tokenizer_path, compressed_weights_path, Path{""}, model_type,
|
|
||||||
pool) {}
|
|
||||||
|
|
||||||
Gemma::~Gemma() = default; // after GemmaInterface is defined
|
Gemma::~Gemma() = default; // after GemmaInterface is defined
|
||||||
|
|
||||||
const sentencepiece::SentencePieceProcessor* Gemma::Tokenizer() const {
|
const sentencepiece::SentencePieceProcessor* Gemma::Tokenizer() const {
|
||||||
|
|
|
||||||
2
gemma.h
2
gemma.h
|
|
@ -76,8 +76,6 @@ struct GemmaInterface;
|
||||||
struct Gemma {
|
struct Gemma {
|
||||||
Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
|
Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
|
||||||
const Path& weights_path, Model model_type, hwy::ThreadPool& pool);
|
const Path& weights_path, Model model_type, hwy::ThreadPool& pool);
|
||||||
Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
|
|
||||||
Model model_type, hwy::ThreadPool& pool);
|
|
||||||
~Gemma(); // must be defined after GemmaInterface's dtor is defined.
|
~Gemma(); // must be defined after GemmaInterface's dtor is defined.
|
||||||
const sentencepiece::SentencePieceProcessor* Tokenizer() const;
|
const sentencepiece::SentencePieceProcessor* Tokenizer() const;
|
||||||
std::unique_ptr<GemmaInterface> impl_;
|
std::unique_ptr<GemmaInterface> impl_;
|
||||||
|
|
|
||||||
2
run.cc
2
run.cc
|
|
@ -234,7 +234,7 @@ void Run(LoaderArgs& loader, InferenceArgs& inference, AppArgs& app) {
|
||||||
[](uint64_t /*task*/, size_t thread) { PinThreadToCore(thread); });
|
[](uint64_t /*task*/, size_t thread) { PinThreadToCore(thread); });
|
||||||
}
|
}
|
||||||
|
|
||||||
gcpp::Gemma model(loader.tokenizer, loader.compressed_weights,
|
gcpp::Gemma model(loader.tokenizer, loader.compressed_weights, loader.weights,
|
||||||
loader.ModelType(), pool);
|
loader.ModelType(), pool);
|
||||||
|
|
||||||
auto kv_cache = CreateKVCache(loader.ModelType());
|
auto kv_cache = CreateKVCache(loader.ModelType());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue