cdpierse / transformers-interpret

Model explainability that works seamlessly with 🤗 transformers. Explain your transformers model in just 2 lines of code.
Apache License 2.0
1.27k stars 96 forks source link

Support for Tensorflow 2 #36

Closed Rishabbh-Sahu closed 3 years ago

Rishabbh-Sahu commented 3 years ago

Hi There, Thanks a lot for creating and sharing this, Its very useful 👍. Are you planning to extend the support for HF tensorflow-2 models in near future?

cdpierse commented 3 years ago

Hi @Rishabbh-Sahu ,

Thank you for the kind words, I'm really glad you are finding the package useful 😊 So support for the Tensorflow 2 models will be tricky because Captum the explainability tool on which this is heavily dependent is exclusive to pytorch. Thankfully Huggingface have some very useful Tensorflow -> Pytorch weight conversion tools which you can read about here.

If you convert your model's weights to pytorch they should be fully compatible with transformers-interpret and the rest should work.

Hopefully that helps, Charles

Rishabbh-Sahu commented 3 years ago

Hi Charles, Thanks for the prompt reply and guiding me to the right direction. I will follow the same as mentioned.

Cheers, Rishabbh