usrbinenv python 2020 the huggingface team licensed under the apache license version 2 0 the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache orglicenseslicense2 0 unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license this script builds a small sample spm file testsfixturestestsentencepiecenobos model with features needed by pegasus 1 pip install sentencepiece 2 wget https raw githubusercontent comgooglesentencepiecemasterdatabotchan txt 3 build pegasus 1 no bos 2 eosid is 1 3 unkid is 2 build a sample spm file accordingly 4 now update the fixture mv testsentencepiecenobos model testsfixtures usr bin env python 2020 the huggingface team licensed under the apache license version 2 0 the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache org licenses license 2 0 unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license this script builds a small sample spm file tests fixtures test_sentencepiece_no_bos model with features needed by pegasus 1 pip install sentencepiece 2 wget https raw githubusercontent com google sentencepiece master data botchan txt 3 build pegasus 1 no bos 2 eos_id is 1 3 unk_id is 2 build a sample spm file accordingly 4 now update the fixture mv test_sentencepiece_no_bos model tests fixtures
import sentencepiece as spm







spm.SentencePieceTrainer.train('--input=botchan.txt --model_prefix=test_sentencepiece_no_bos --bos_id=-1 --unk_id=2  --eos_id=1  --vocab_size=1000')