diff options
author | CoprDistGit <infra@openeuler.org> | 2024-04-16 06:35:48 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-04-16 06:35:48 +0000 |
commit | 59a54518faf06f2500c12e029facd7a1a37871e2 (patch) | |
tree | 7721ffac23b0345a964a6ad1e324d15d71d8fbae | |
parent | 47df95c9eb02f5e16fc9e632ae59e17b387eb3ff (diff) |
automatic import of sentencepiece
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | sentencepiece.spec | 99 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 101 insertions, 0 deletions
@@ -0,0 +1 @@ +/sentencepiece-0.1.99.tar.gz diff --git a/sentencepiece.spec b/sentencepiece.spec new file mode 100644 index 0000000..7096c47 --- /dev/null +++ b/sentencepiece.spec @@ -0,0 +1,99 @@ +Name: sentencepiece +Version: 0.1.99 +Release: %autorelease +Summary: An unsupervised text tokenizer for Neural Network-based text generation + +License: Apache-2.0 +URL: https://github.com/google/sentencepiece +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz#/sentencepiece-%{version}.tar.gz + +# https://github.com/google/sentencepiece/issues/860 +ExcludeArch: s390x + +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: ninja-build +BuildRequires: gperftools-devel +BuildRequires: pkgconfig +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description +The SentencePiece is an unsupervised text tokenizer for Neural Network-based +text generation. +It is an unsupervised text tokenizer and detokenizer mainly for +Neural Network-based text generation systems where the vocabulary size is +predetermined prior to the neural model training. +SentencePiece implements subword units and unigram language model with the +extension of direct training from raw sentences. +SentencePiece allows us to make a purely end-to-end system that does not +depend on language-specific pre/post-processing. + +%package libs +Summary: Runtime libraries for SentencePiece + +%description libs +This package contains the libraries for SentencePiece. + +%package tools +Summary: Tools for SentencePiece +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description tools +This package contains tools for manipulate models for SentencePiece. + +%package devel +Summary: Libraries and header files for SentencePiece +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +This package contains header files to develop a software using SentencePiece. + +%package -n python3-%{name} +Summary: Python module for SentencePiece +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-%{name}} + +%description -n python3-%{name} +This package contains Python3 module file for SentencePiece. + +%prep +%autosetup +%build +%cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + +%cmake_build +pushd python +CFLAGS="-I../src" LDFLAGS="-L../%{_vpath_builddir}/src -lsentencepiece" PKG_CONFIG_PATH="../%{_vpath_builddir}" %py3_build +popd + +%install +%cmake_install +pushd python +%py3_install +popd + +rm %{buildroot}%{_libdir}/libsentencepiece*.a + +%files libs +%doc README.md +%license LICENSE +%{_libdir}/libsentencepiece*.so.0* + +%files devel +%{_includedir}/sentencepiece*.h +%{_libdir}/*.so +%{_libdir}/pkgconfig/sentencepiece*.pc + +%files tools +%{_bindir}/spm* + +%files -n python3-%{name} +%{python3_sitearch}/%{name}/ +%{python3_sitearch}/%{name}-*.egg-info/ + + +%changelog +%autochangelog @@ -0,0 +1 @@ +14c0d543483d463054a01cdb3743b992 sentencepiece-0.1.99.tar.gz |