Skip to content

Commit

Permalink
Use zip instead of tar to avoid issues with symlinks on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunk committed Jul 8, 2023
1 parent d1efcf5 commit aaa9448
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sentencepiece/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ if [[ -z "$PLATFORM" ]]; then
fi

SENTENCEPIECE_VERSION=0.1.99
download https://github.com/google/sentencepiece/archive/refs/tags/v$SENTENCEPIECE_VERSION.tar.gz sentencepiece-$SENTENCEPIECE_VERSION.tar.gz
download https://github.com/google/sentencepiece/archive/refs/tags/v$SENTENCEPIECE_VERSION.zip sentencepiece-$SENTENCEPIECE_VERSION.zip

mkdir -p $PLATFORM
cd $PLATFORM
INSTALL_PATH=`pwd`
echo "Decompressing archives..."
tar -xzvf ../sentencepiece-$SENTENCEPIECE_VERSION.tar.gz

unzip -o ../sentencepiece-$SENTENCEPIECE_VERSION.zip

cd sentencepiece-$SENTENCEPIECE_VERSION

CMAKE_CONFIG="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH -DCMAKE_INSTALL_LIBDIR=$INSTALL_PATH/lib"
Expand Down
5 changes: 5 additions & 0 deletions sentencepiece/samples/SentencepieceExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import org.bytedeco.javacpp.*;
import org.bytedeco.sentencepiece.*;

/**
* To try encoding you can download an existing model, i.e.
* wget https://nlp.h-its.org/bpemb/en/en.wiki.bpe.vs10000.model
* mvn compile exec:java -e -Dexec.mainClass=SentencepieceExample -D exec.args="en.wiki.bpe.vs10000.model"
*/
public final class SentencepieceExample {

public static void main(String[] args) {
Expand Down

0 comments on commit aaa9448

Please sign in to comment.