summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-04-16 01:53:50 +0000
committerCoprDistGit <infra@openeuler.org>2024-04-16 01:53:50 +0000
commit1095910b6adc732a25711661922406eb67687b7b (patch)
treedd696baa1d651421620211d8b371c2ebbb8ef7b5
parent56566d89501adff5d1454aa545d6f73ae59f1d70 (diff)
automatic import of transformers
-rw-r--r--.gitignore1
-rw-r--r--sources2
-rw-r--r--transformers.spec82
3 files changed, 45 insertions, 40 deletions
diff --git a/.gitignore b/.gitignore
index f194d34..7477c7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/v4.39.0.tar.gz
+/transformers-4.39.0.tar.gz
diff --git a/sources b/sources
index bed34a9..b4facab 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ee67a15fa896751c244882aefd446a8d v4.39.0.tar.gz
+0e95db1495782866ac6708efc58bb227 transformers-4.39.0.tar.gz
diff --git a/transformers.spec b/transformers.spec
index d0f6a84..90452c3 100644
--- a/transformers.spec
+++ b/transformers.spec
@@ -1,66 +1,70 @@
%global _empty_manifest_terminate_build 0
%global _unpackaged_files_terminate_build 0
-Name: transformers
-Version: 4.39.0
-Release: 1%{?dist}
-Summary: Transformers provides thousands of pretrained models to perform tasks on different modalities.
-License: Apache-2.0
-URL: https://huggingface.co/docs/transformers/index
-Source0: https://github.com/huggingface/%{name}/archive/refs/tags/v%{version}.tar.gz
-Requires: python3-pytorch
-Requires: python3-filelock
-Requires: python3-packaging
-Requires: python3-numpy
-Requires: python3-pyyaml
-Requires: python3-regex
-Requires: python3-requests
-Requires: python3-safetensors
-Requires: python3-tqdm
-Requires: python3-tokenizers
-Requires: python3-huggingface-hub
+# using global macro to speed up the spec editing
+%global pkg_name transformers
+%global version 4.39.0
+%global pkg_summary Transformers provides thousands of pretrained models to perform tasks on different modalities.
+%global pkg_desc %{expand:%{pkg_summary}}
+%global open_license Apache-2.0
-%description
-transformers is a popular library for natural language processing (NLP) tasks, especially in the domain of transfer learning for NLP. The transformers library provides pre-trained models (such as BERT, GPT, RoBERTa, etc.) that can be easily fine-tuned on custom datasets for tasks like text classification, question answering, text generation, and more.
+Name: %{pkg_name}
+Version: %{version}
+Release: 1
+Summary: %{pkg_summary}
+License: %{open_license}
+# the url and source0 url here
+URL: https://huggingface.co/docs/transformers/index
+Source0: https://github.com/huggingface/%{name}/archive/refs/tags/v%{version}.tar.gz#/transformers-%{version}.tar.gz
-# pkg section 1
-%package -n python3-transformers
-Summary: a python3-lib provides transformers functionality
-Provides: python3-transformers
+# build requires
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-hatchling
BuildRequires: python3-setuptools_scm
-%description -n python3-transformers
-python3-transformers provides APIs for transformers realize.
-# pkg section 2
-%package -n help
-Summary: docs for the transformers
-Provides: python3-transformers-doc
-%description -n help
-description for the doc of the python3-transformers
+# higharchy desc
+%description
+%{pkg_summary}
+
+# sub pkg section 1
+%package -n python3-%{pkg_name}
+Summary: %{pkg_summary}
+%description -n python3-%{pkg_name}
+%{pkg_desc}
+
+# pkg section: help optional
+# %package -n help
+# Summary: docs for the transformers
+# Provides: python3-transformers-doc
+# %description -n help
+# description for the doc of the python3-transformers
+
+# the name here should match the name of the dir of the source code zip
+# which got from the .tar.gz unzipped
%prep
%autosetup -p1 -n transformers-%{version}
+# using python poject build, supplied by setup.py or pyproject.toml
%build
%pyproject_build
+# using python project install, supplied by setup.py or pyproject.toml
%install
-# rm -rf $RPM_BUILD_ROOT
%pyproject_install
-%files -n python3-transformers
+# point out the files here
+%files -n python3-%{pkg_name}
%doc *.md
-%license LICENSE
-%{_bindir}/transformers-cli
-%{python3_sitelib}/transformers/*
-%{python3_sitelib}/transformers-%{version}.dist-info/*
+%license LICENSE*
+%{python3_sitearch}/%{pkg_name}*
+%{python3_sitelib}/%{pkg_name}*
+
%changelog
-* Sat Mar 30 2024 youser<1328699220@qq.com>
+* Mon Apr 15 2024 youser<1328699220@qq.com>
- pkg init