Skip to content

Commit 3f536fc

Browse files
authored
Merge pull request #13 from pytorch-labs/error_msg
Improve error message
2 parents 08e3cfa + 479a90e commit 3f536fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sentencepiece.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Error SPTokenizer::load(const std::string &tokenizer_path) {
3838
const auto status = _processor->Load(tokenizer_path);
3939
if (!status.ok()) {
4040
fprintf(stderr,
41-
"couldn't load %s\n. It is likely that the tokenizer artifact is "
41+
"couldn't load %s. \nError message: \n%s\n"
42+
"It is likely that the tokenizer artifact is "
4243
"broken or of a different format.",
43-
tokenizer_path.c_str());
44+
tokenizer_path.c_str(), status.error_message());
4445
return Error::LoadFailure;
4546
}
4647
// load vocab_size, bos_tok, eos_tok

0 commit comments

Comments
 (0)