2023-03-23 18:03:15 +03:00
|
|
|
distributable:
|
|
|
|
url: https://github.com/google/sentencepiece/archive/v{{version}}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: google/sentencepiece/releases/tags
|
2024-02-21 22:49:49 +03:00
|
|
|
ignore: '1.0.0' # whoops, who tagged this then?
|
2023-03-23 18:03:15 +03:00
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
cmake.org: ^3
|
2024-02-21 22:49:49 +03:00
|
|
|
python.org: ~3.11
|
2023-03-25 00:53:39 +03:00
|
|
|
pip.pypa.io: '*'
|
|
|
|
freedesktop.org/pkg-config: ~0.29
|
2024-02-21 22:49:49 +03:00
|
|
|
protobuf.dev: 25
|
2023-03-23 18:03:15 +03:00
|
|
|
working-directory: build
|
2024-02-21 22:49:49 +03:00
|
|
|
script:
|
|
|
|
- cmake .. $CMAKE_ARGS
|
|
|
|
- make --jobs {{ hw.concurrency }} install
|
2023-03-23 18:03:15 +03:00
|
|
|
|
2024-02-21 22:49:49 +03:00
|
|
|
# FIXME: this fails for linux in v0.2.0
|
|
|
|
- run: pip install ../python --verbose --prefix="{{prefix}}"
|
|
|
|
if: darwin
|
|
|
|
env:
|
|
|
|
# pip needs this to find our new package
|
|
|
|
PKG_CONFIG_PATH: '$PKG_CONFIG_PATH:{{prefix}}/lib/pkgconfig'
|
|
|
|
CMAKE_ARGS:
|
|
|
|
- -DCMAKE_INSTALL_PREFIX="{{prefix}}"
|
|
|
|
- -DCMAKE_BUILD_TYPE=Release
|
2023-03-25 00:53:39 +03:00
|
|
|
|
2023-03-23 18:03:15 +03:00
|
|
|
provides:
|
|
|
|
- bin/spm_decode
|
|
|
|
- bin/spm_encode
|
|
|
|
- bin/spm_export_vocab
|
|
|
|
- bin/spm_normalize
|
|
|
|
- bin/spm_train
|
|
|
|
|
2023-03-25 00:53:39 +03:00
|
|
|
runtime:
|
|
|
|
env:
|
|
|
|
PYTHONPATH: '{{prefix}}/lib/python3.11/site-packages'
|
|
|
|
|
2023-03-23 18:03:15 +03:00
|
|
|
test:
|
|
|
|
dependencies:
|
|
|
|
gnu.org/wget: '*'
|
2024-02-21 22:49:49 +03:00
|
|
|
python.org: ~3.11
|
|
|
|
script:
|
|
|
|
- wget https://raw.githubusercontent.com/google/sentencepiece/master/data/botchan.txt
|
|
|
|
- spm_train --input=botchan.txt --model_prefix=m --vocab_size=1000
|
2023-03-25 00:53:39 +03:00
|
|
|
|
2024-02-21 22:49:49 +03:00
|
|
|
# FIXME: linux build
|
|
|
|
- run: python -c 'import sentencepiece as spm; spm.SentencePieceProcessor()'
|
|
|
|
if: darwin
|