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

[P0] Rename train/evaluate methods so train/eval can set model state #120

Closed aryamanarora closed 4 months ago

aryamanarora commented 4 months ago

Description

Currently IntervenableModel.train() and IntervenableModel.evaluate() are helper methods for training and evaluating interventions in a simple interface. I am renaming these to train_alignment() and eval_alignment() so that train() and eval() can set the model state (so that HF trainer can be compatible with this interface).

I think we have not actually been using these in pyvene-based projects because they don't allow much customisation so this doesn't break much; just had to change one notebook.

Testing Done

Tested in current project and worked. Let's see if tests pass!

Checklist:

aryamanarora commented 4 months ago

For #121.