Skip to content

Commit

Permalink
Fix python
Browse files Browse the repository at this point in the history
  • Loading branch information
pkufool committed Sep 3, 2023
1 parent d8bbc6a commit 39c0e14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
16 changes: 10 additions & 6 deletions cmake/sentencepiece.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ function(download_sentencepiece)
${sentencepiece_BINARY_DIR}
)

target_include_directories(sentencepiece-static
INTERFACE
${sentencepiece_SOURCE_DIR}
${sentencepiece_SOURCE_DIR}/src
${sentencepiece_BINARY_DIR}
)
if(SHERPA_ONNX_ENABLE_PYTHON AND WIN32)
install(TARGETS sentencepiece DESTINATION ..)
else()
install(TARGETS sentencepiece DESTINATION lib)
endif()

if(WIN32 AND BUILD_SHARED_LIBS)
install(TARGETS sentencepiece DESTINATION bin)
endif()

endfunction()

download_sentencepiece()
2 changes: 1 addition & 1 deletion sherpa-onnx/csrc/utf-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool StringToUnicodePoints(const std::string &str,
std::string CodepointToUTF8String(int32_t code) {
std::ostringstream ostr;
if (code < 0) {
SHERPA_ONNX_LOGE("Invalid code point : $d", code);
SHERPA_ONNX_LOGE("Invalid code point : %d", code);
exit(-1);
} else if (code < 0x80) {
ostr << static_cast<char>(code);
Expand Down
1 change: 1 addition & 0 deletions sherpa-onnx/csrc/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#include "sherpa-onnx/csrc/log.h"
Expand Down

0 comments on commit 39c0e14

Please sign in to comment.