Trained models & code to predict toxic comments on all 3 Jigsaw Toxic Comment Challenges. Built using ⚡ Pytorch Lightning and 🤗 Transformers. For access to our API, please email us at contact@unitary.ai.
Python: 3.10.9
I am getting AttributeError: module 'torch' has no attribute 'no_grad' error when trying to run a simple code, following the short guide inside read me. I am new to Python, I am sorry if my mistake is too obvious.
from detoxify import Detoxify
results = Detoxify('original').predict('example text')
print(results)
Full error:
Traceback (most recent call last):
File "G:\Deving\Saihex\BOSS-FEEDBACK-BACKEND\index.py", line 1, in <module>
from detoxify import Detoxify
File "C:\Py3.10.9\lib\site-packages\detoxify\__init__.py", line 1, in <module>
from .detoxify import (
File "C:\Py3.10.9\lib\site-packages\detoxify\detoxify.py", line 73, in <module>
class Detoxify:
File "C:\Py3.10.9\lib\site-packages\detoxify\detoxify.py", line 112, in Detoxify
@torch.no_grad()
AttributeError: module 'torch' has no attribute 'no_grad'
Python: 3.10.9 I am getting
AttributeError: module 'torch' has no attribute 'no_grad'
error when trying to run a simple code, following the short guide inside read me. I am new to Python, I am sorry if my mistake is too obvious.Full error: