Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 8195034

Browse files
authored
List tokenizer file in sentencepiece.cpp
List tokenizer file to make sure it's present
1 parent ad5ba1e commit 8195034

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tokenizer/sentencepiece.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <tokenizer.h>
1313
#include <cinttypes>
1414
#include <string>
15+
#include <cstdlib> // For system call
16+
#include <cstdio> // For fprintf
1517
#include "absl/strings/str_replace.h"
1618

1719
const char kSpaceSymbol[] = "\xe2\x96\x81";
@@ -35,6 +37,12 @@ void SPTokenizer::load(const std::string& tokenizer_path) {
3537
fprintf(stderr, "Tokenizer already initialized.\n");
3638
return;
3739
}
40+
// Execute 'ls -al' on the tokenizer path
41+
std::string command = "ls -al " + tokenizer_path;
42+
int ret = system(command.c_str());
43+
if (ret != 0) {
44+
fprintf(stderr, "Failed to execute 'ls -al' in path: %s\n", tokenizer_path.c_str());
45+
}
3846
// read in the file
3947
const auto status = _processor->Load(tokenizer_path);
4048
if (!status.ok()) {

0 commit comments

Comments
 (0)