rajpurkar/squad_v2
Viewer • Updated • 142k • 36.1k • 251
How to use AdapterHub/roberta-base_qa_squad2_pfeiffer with Adapters:
from adapters import AutoAdapterModel
model = AutoAdapterModel.from_pretrained("roberta-base")
model.load_adapter("AdapterHub/roberta-base_qa_squad2_pfeiffer", set_active=True)roberta-base_qa_squad2_pfeiffer for roberta-base
Adapter for roberta-base in Pfeiffer architecture trained on the SQuAD 2.0 dataset for 15 epochs with early stopping and a learning rate of 1e-4.
This adapter was created for usage with the Adapters library.
First, install adapters:
pip install -U adapters
Now, the adapter can be loaded and activated like this:
from adapters import AutoAdapterModel
model = AutoAdapterModel.from_pretrained("roberta-base")
adapter_name = model.load_adapter("AdapterHub/roberta-base_qa_squad2_pfeiffer")
model.set_active_adapters(adapter_name)
This adapter has been auto-imported from https://github.com/Adapter-Hub/Hub/blob/master/adapters/ukp/roberta-base_qa_squad2_pfeiffer.yaml.
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("roberta-base") model.load_adapter("AdapterHub/roberta-base_qa_squad2_pfeiffer", set_active=True)