inseq-team / inseq

Interpretability for sequence generation models 🐛 🔍
https://inseq.org
Apache License 2.0
378 stars 36 forks source link

Add support for `device_map` use #264

Closed gsarti closed 7 months ago

gsarti commented 7 months ago

Description

This PR adds support for using a custom device_map in the loaded HF model, avoiding to cast it to a device in AttributionModel.setup() if the device map is specified, and dispatching it using the accelerate.dispatch_model method instead.