Adversarial-Deep-Learning / code-soup

This is a collection of algorithms and approaches used in the book adversarial deep learning
MIT License
18 stars 18 forks source link

Wrapper for Hugging Face models #97

Open abheesht17 opened 2 years ago

abheesht17 commented 2 years ago

Make a wrapper class for Hugging Face models. The class will initialise the model (and the tokeniser). Perform a forward pass on an input list of text. We need functions like get_grad() too, since some attacks require grads.

Reference: https://github.com/QData/TextAttack/blob/master/textattack/models/wrappers/huggingface_model_wrapper.py