Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5ForConditionalGeneration requires the PyTorch library but it was not found in your environment. #3

Open
tylertaewook opened this issue Aug 1, 2022 · 1 comment

Comments

@tylertaewook
Copy link

when doing kp_model = KeyPhraseTransformer(), it's suddenly complaining that PyTorch library is not installed in my local environment. The requirements.txt from your repo had torch commented out, and I had no issue so far using your library without torch library.

Would you happen to possibly know what might be causing this issue? It works fine when I install torch==1.2.0, but doing so will take around 4 minutes to load the KeyPhraseTransformer() model every time.

scraft-server-web-1       |   File "/code/nlp/views.py", line 44, in post
scraft-server-web-1       |     kp_model = load_model()
scraft-server-web-1       |   File "/code/nlp/services.py", line 7, in load_model
scraft-server-web-1       |     kp_model = KeyPhraseTransformer()
scraft-server-web-1       |   File "/usr/local/lib/python3.8/site-packages/keyphrasetransformer/keyphrasetransformer.py", line 16, in __init__
scraft-server-web-1       |     self.model = T5ForConditionalGeneration.from_pretrained(self.model_name)
scraft-server-web-1       |   File "/usr/local/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 918, in __getattr__
scraft-server-web-1       |     requires_backends(cls, cls._backends)
scraft-server-web-1       |   File "/usr/local/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 906, in requires_backends
scraft-server-web-1       |     raise ImportError("".join(failed))
scraft-server-web-1       | ImportError: 
scraft-server-web-1       | T5ForConditionalGeneration requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
scraft-server-web-1       | installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
@kunalgoyal9
Copy link

#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants