deep-spin / entmax

The entmax mapping and its loss, a family of sparse softmax alternatives.
MIT License
407 stars 43 forks source link

Release patch 1.0.1 with torch install_requires fix #26

Closed tgaddair closed 1 year ago

tgaddair commented 2 years ago

Thanks for creating this useful library. We recently included it as part of our low code toolkit, Ludwig. However, we ran into an issue whereby if the user does not have torch already installed before installing entmax, it raises an exception:

× python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xasbhx2w/entmax_64da4068d2414a04a5c3adc7187695b4/setup.py", line 2, in <module>
          from entmax import __version__
        File "/tmp/pip-install-xasbhx2w/entmax_64da4068d2414a04a5c3adc7187695b4/entmax/__init__.py", line 3, in <module>
          from entmax.activations import sparsemax, entmax15, Sparsemax, Entmax15
        File "/tmp/pip-install-xasbhx2w/entmax_64da4068d2414a04a5c3adc7187695b4/entmax/activations.py", line 13, in <module>
          import torch
      ModuleNotFoundError: No module named 'torch'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Looks like this was fixed some time back here, but this change was made after the v1.0 release, meaning the current production release has this bug. Can you create a patch release v1.0.1 that includes this fix?

Thanks.

bpopeters commented 2 years ago

Hello,

I'll try to take care of this before the end of the week. Thank you for your interest!

cifkao commented 2 years ago

I would also very much appreciate this! I'm depending on a package which depends on entmax and this issue is unfortunately breaking my setup.

cifkao commented 2 years ago

Actually, this does not really fix the issue. #27 or #25 (which I noticed only after submitting #27) does. @bpopeters Would you please consider merging one of these PRs and releasing a patch?

lukas-blecher commented 2 years ago

@bpopeters (or @vene) please merge one of the above and release a new version.

bpopeters commented 1 year ago

Fixed via #25.