Package Details: python-transformers 4.57.1-2

Git Clone URL: https://aur.archlinux.org/python-transformers.git (read-only, click to copy)
Package Base: python-transformers
Description: State-of-the-art Natural Language Processing for Jax, PyTorch and TensorFlow
Upstream URL: https://github.com/huggingface/transformers
Keywords: huggingface transformers
Licenses: Apache-2.0
Submitter: filipg
Maintainer: daskol
Last Packager: daskol
Votes: 16
Popularity: 0.67
First Submitted: 2021-10-23 09:30 (UTC)
Last Updated: 2025-11-22 20:31 (UTC)

Sources (1)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

AllesMeins commented on 2023-03-22 21:43 (UTC) (edited on 2023-03-22 21:44 (UTC) by AllesMeins)

Building of the latest version fails for me. Previous version was building fine:

==> Starting build()...
* Getting build dependencies for wheel...
running egg_info
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
    self.run_setup()
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
    super(_BuildMetaLegacyBackend,
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 419, in <module>
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 253, in finalize_options
    if pd is not None and pd.key == self.egg_name.lower():
AttributeError: 'PathDistribution' object has no attribute 'key'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
==> ERROR: A failure occurred in build().

filipg commented on 2022-12-10 08:26 (UTC)

Applied patch, updated version

kIERO commented on 2022-11-30 14:22 (UTC)

Maintainer: @filipg is MIA

kIERO commented on 2022-10-08 21:33 (UTC)

I've successfully built version 4.22.2 with the patch by @ChrisMorgan below

blinry commented on 2022-09-22 17:40 (UTC)

Very nice comments, ChrisMorgan! filipg, I'd love it if these changes were applied! \o/

ChrisMorgan commented on 2022-09-10 10:47 (UTC)

This package’s dependencies don’t correspond very well to the dependencies expressed by the actual Python package (for which refer to /usr/lib/python3.10/site-packages/transformers-4.19.2-py3.10.egg-info/requires.txt).

  • Remove cuda and nccl. (transformers does not depend on them at all; PyTorch may, so packages like python-pytorch-opt-cuda depend on these two.)
  • Keep python-filelock, python-tokenizers and python-tqdm.
  • Remove python-sacremoses. It’s marked as exclusively a test dependency, and there are a bunch of other things missing from the checkdepends if you want to actually test it. (Caveat to this statement: a few children of transformers.models do actually look to use it, some optionally and some mandatorily. Not sure quite what’s up with that, but I think the requirements lists may be at fault and perhaps it should have another feature set for it, and perhaps here it should be optdepends. I don’t know how this stuff is used.)
  • Add python-huggingface-hub, python-numpy, python-packaging, python-yaml, python-regex, python-requests.
  • Start by removing python-pytorch (it’s optional), then probably add it to optdepends as well as the items of at least the flax, torch and tf sets from requires.txt (and there are a lot more optional dependencies that could be worth including, if interested in exhaustiveness).

Here’s a start (with only one fly in the ointment, that python-optax doesn’t exist yet, so JAX support is actually not yet readily attainable):

diff --git a/PKGBUILD b/PKGBUILD
index 4763dde..d808b71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,13 +7,25 @@ pkgdesc="State-of-the-art Natural Language Processing for Jax, PyTorch and Tenso
 arch=('i686' 'x86_64')
 url="https://pypi.org/project/transformers"
 license=('Apache License 2.0')
-depends=('cuda'
-         'nccl'
-         'python-filelock'
-         'python-pytorch'
-         'python-sacremoses'
+depends=('python-filelock'
          'python-tokenizers'
+         'python-huggingface-hub'
+         'python-numpy'
+         'python-packaging'
+         'python-yaml'
+         'python-regex'
+         'python-requests'
          'python-tqdm')
+optdepends=(
+       'python-pytorch: PyTorch support'
+       'python-tensorflow: TensorFlow support'
+       'python-onnxconverter-common: TensorFlow support'
+       'python-tf2onn: TensorFlow support'
+       'python-jax: JAX support'
+       'python-jaxlib: JAX support'
+       'python-flax: JAX support'
+       'python-optax: JAX support'
+)

 source=("https://github.com/huggingface/transformers/archive/refs/tags/v${pkgver}.tar.gz")
 sha256sums=('a1cdffb59b0a409cb5de414fcfaf5208f4526023cd021245f37f309bb15673a9')