Felflare / rpunct

📝An easy-to-use package to restore punctuation of the text.
108 stars 70 forks source link

ValueError: 'use_cuda' set to True when cuda is unavailable.Make sure CUDA is available or set use_cuda=False. #1

Open bekmuradov opened 3 years ago

bekmuradov commented 3 years ago

Hi, I am trying to run rpunct but getting following error in the console. This is the error from the console: File "app.py", line 3, in rpunct = RestorePuncts() File "/home/beck/miniconda3/envs/restore_punctuation/lib/python3.7/site-packages/rpunct/punctuate.py", line 18, in init args={"silent": True, "max_seq_length": 512}) File "/home/beck/miniconda3/envs/restore_punctuation/lib/python3.7/site-packages/simpletransformers/ner/ner_model.py", line 212, in init "'use_cuda' set to True when cuda is unavailable." ValueError: 'use_cuda' set to True when cuda is unavailable.Make sure CUDA is available or set use_cuda=False.

How can I pass argument to RestorePuncts() to set cuda to False?

somiljain7 commented 3 years ago

I am having the same issue. does it got resolved ?

PeterBourgonje commented 3 years ago

Ran into this issue as well. Work-around I used is to manually set use_cuda to False. In my case, line 114 in /usr/local/lib/python3.8/dist-packages/simpletransformers/ner/ner_model.py

EDIT: this fork seems to address the issue as well: https://github.com/ernie-mlg/rpunct

yangliu2 commented 2 years ago

same issue. Or use use_cuda=torch.cuda.is_available() to detect whether to use cuda.