summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 66404c76f0fe35d86cc63af5b0baed233091fb20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Will Handley <wh260@cam.ac.uk>
pkgname=python-transformers-git
_pkgname=transformers
pkgver=r22511.3c307e380ad
pkgrel=1
pkgdesc='State-of-the-art pretrained models for inference and training'
arch=('any')
url='https://github.com/huggingface/transformers'
license=('Apache-2.0')
depends=(
  'python-huggingface-hub>=1:1.3.0'
  'python-numpy'
  'python-packaging'
  'python-regex'
  'python-safetensors'
  'python-tokenizers'
  'python-tqdm'
  'python-typer'
  'python-yaml'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
  'git'
)
optdepends=(
  'python-bitsandbytes: 8-bit support for PyTorch'
  'python-flax: JAX support'
  'python-keras: Support for models in Keras 3'
  'python-pytorch: PyTorch support'
  'python-tensorflow: TensorFlow support'
)
provides=('python-transformers')
conflicts=('python-transformers')
source=("${_pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${_pkgname}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pkgname}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
}