Skip to content

Commit

Permalink
Fix reading tokens.txt on Windows (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Nov 25, 2023
1 parent 8444d54 commit 66cad9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sherpa-onnx/csrc/lexicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static std::unordered_map<std::string, int32_t> ReadTokens(std::istream &is) {
iss >> id;
}

// eat the trailing \r\n on windows
iss >> std::ws;
if (!iss.eof()) {
SHERPA_ONNX_LOGE("Error: %s", line.c_str());
exit(-1);
Expand Down

0 comments on commit 66cad9f

Please sign in to comment.