stanfordnlp / pyvene

Stanford NLP Python Library for Understanding and Improving PyTorch Models via Interventions
http://pyvene.ai
Apache License 2.0
545 stars 46 forks source link

[Minor] Support zero_grad as a module #124

Closed frankaging closed 4 months ago

frankaging commented 4 months ago

Description

Create the zero_grad() function for intervenable model to make it compatible with external trainers (e.g., HF trainer).

Testing Done

Running default tests.

Checklist: