pyvene是一个开源Python库,用于干预PyTorch模型的内部状态。干预在人工智能的许多领域都是一项重要操作,包括模型编辑、引导、鲁棒性和可解释性。
pyvene具有许多使干预变得简单的功能:
pyvene正在积极开发中,并不断改进 🫡
[!重要] 在https://stanfordnlp.github.io/pyvene/阅读pyvene文 档!
要安装pyvene的最新稳定版本:
pip install pyvene
或者,要安装最新版本,您可以克隆仓库并安装:
git clone git@github.com:stanfordnlp/pyvene.git
cd pyvene
pip install -e .
当您想更新时,只需在克隆的目录中运行git pull
即可。
我们建议按以下方式导入库:
import pyvene as pv
如果您使用此仓库,请考虑引用我们的库论文:
@inproceedings{wu-etal-2024-pyvene, title = "pyvene: A Library for Understanding and Improving {P}y{T}orch Models via Interventions", author = "Wu, Zhengxuan and Geiger, Atticus and Arora, Aryaman and Huang, Jing and Wang, Zheng and Goodman, Noah and Manning, Christopher and Potts, Christopher", editor = "Chang, Kai-Wei and Lee, Annie and Rajani, Nazneen", booktitle = "Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 3: System Demonstrations)", month = jun, year = "2024", address = "Mexico City, Mexico", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2024.naacl-demo.16", pages = "158--165", }