Problems faced while installing transformers from source

And how I solved them

Recently I installed the Huggingface Transformers on Windows following their contributing guidelines. Outlined below are some of the problems that I faced during the setup process and how I fixed them. If you have a better way of solving these issues please do let me know.

Ray package fails to install on python 3.10

Initially I tried setting up the development environment using a python version of 3.10.2 and faced an issue while installing the Ray package. The issue faced is similar to this issue, and the workaround was simply to downgrade to python 3.9.13.

Latest kenLM package fails to build on windows

The second problem I faced was that kenLM package was failing to install on windows. There is an open issue on the kenLM github repo regarding this problem and the simple solution is to revert to an earlier commit of the package as shown in this pull request

Problem with the Pytorch distributed library on Windows.

The third problem I faced was while running the doctests for the transformers library. It turns out the problem was that the Pytorch was using a linux-specific attribute, which is the code signal.SIGKILL which is not available for windows. There is an open issue about this on the Pytorch github and it seems they have set the tag of high priority on it, at the time of writing this post. So this issue should be fixed very soon. I solved this issue by changing signal.SIGKILL to signal.SIGTERM but it seems pytorch already has a function that takes into account the OS, which is most likely going to be the fix.

Conclusion

These problems are related to a Windows installation process and might not be applicable on other OS distributions. Also, this problem relates to the date 31 October 2022 and most likely will be fixed on future updates of the respective packages. Please do let me know of any feedback that you and I hope this post was able to help you in some way :D