Skip to content

Commit

Permalink
fix tokenizer scope
Browse files Browse the repository at this point in the history
  • Loading branch information
austinvhuang committed Mar 10, 2024
1 parent 0fc80fa commit 5d323c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gemma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ void GemmaImpl<ConfigGemma7B>::Generate(
Gemma::Gemma(const Path& tokenizer_path, const Path& compressed_weights_path,
const Path& weights_path, Model model_type,
hwy::ThreadPool& pool) {
std::unique_ptr<sentencepiece::SentencePieceProcessor> tokenizer;
{
PROFILER_ZONE("Startup.tokenizer");
std::unique_ptr<sentencepiece::SentencePieceProcessor> tokenizer =
std::make_unique<sentencepiece::SentencePieceProcessor>();
tokenizer = std::make_unique<sentencepiece::SentencePieceProcessor>();
if (!tokenizer->Load(tokenizer_path.path).ok()) {
HWY_ABORT("Failed to load the tokenizer file.");
}
Expand Down

0 comments on commit 5d323c0

Please sign in to comment.