mirror of
https://github.com/google/sentencepiece.git
synced 2024-12-29 11:11:58 +03:00
docs: add windows build instructions
This commit is contained in:
parent
9263680010
commit
0eb24d2ff1
@ -3,7 +3,7 @@
|
|||||||
Python wrapper for SentencePiece. This API will offer the encoding, decoding and training of Sentencepiece.
|
Python wrapper for SentencePiece. This API will offer the encoding, decoding and training of Sentencepiece.
|
||||||
|
|
||||||
## Build and Install SentencePiece
|
## Build and Install SentencePiece
|
||||||
For Linux (x64/i686), macOS, and Windows(win32/x64) environment, you can simply use pip command to install SentencePiece python module.
|
For Linux (x64/i686), macOS, and Windows(win32/x64/arm64) environment, you can simply use pip command to install SentencePiece python module.
|
||||||
|
|
||||||
```
|
```
|
||||||
% pip install sentencepiece
|
% pip install sentencepiece
|
||||||
@ -27,6 +27,20 @@ If you don’t have write permission to the global site-packages directory or do
|
|||||||
% python setup.py install --user
|
% python setup.py install --user
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For Windows users who want to build from source, you can build and install the Python wrapper using Visual Studio. First, you need to install the `pwsh.exe` (Powershell 7). Use `winget install --id Microsoft.Powershell --source winget` to install directly. Then open the `Developer PowerShell for VS 2022`, and execute the following commands.
|
||||||
|
```
|
||||||
|
git clone https://github.com/google/sentencepiece.git
|
||||||
|
cd sentencepiece
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=".\root"
|
||||||
|
cmake --build . --config Release --target install
|
||||||
|
cd ../python
|
||||||
|
pip install wheel
|
||||||
|
python setup.py bdist_wheel
|
||||||
|
Get-ChildItem .\dist\sentencepiece*.whl | ForEach-Object { pip install $_.FullName }
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
See [this google colab page](https://github.com/google/sentencepiece/blob/master/python/sentencepiece_python_module_example.ipynb) to run sentencepiece interactively.
|
See [this google colab page](https://github.com/google/sentencepiece/blob/master/python/sentencepiece_python_module_example.ipynb) to run sentencepiece interactively.
|
||||||
|
Loading…
Reference in New Issue
Block a user