Instructions to use shahrukhx01/roberta-base-squad2-boolq-baseline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shahrukhx01/roberta-base-squad2-boolq-baseline with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="shahrukhx01/roberta-base-squad2-boolq-baseline")# Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("shahrukhx01/roberta-base-squad2-boolq-baseline") model = AutoModelForQuestionAnswering.from_pretrained("shahrukhx01/roberta-base-squad2-boolq-baseline", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit 路
ad3bde6
1
Parent(s): d8871b0
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,4 +19,17 @@ eval_best_f1 = 82.9231 <br/>
|
|
| 19 |
eval_exact = 79.9208 <br/>
|
| 20 |
eval_f1 = 82.9231 <br/>
|
| 21 |
eval_samples = 12165 <br/>
|
| 22 |
-
eval_total = 11873
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
eval_exact = 79.9208 <br/>
|
| 20 |
eval_f1 = 82.9231 <br/>
|
| 21 |
eval_samples = 12165 <br/>
|
| 22 |
+
eval_total = 11873
|
| 23 |
+
|
| 24 |
+
## Uasge in transformers
|
| 25 |
+
Import the script from [here](https://huggingface.co/shahrukhx01/roberta-base-squad2-boolq-baseline/blob/main/multitask_model.py)
|
| 26 |
+
```python
|
| 27 |
+
from multitask_model import RobertaForMultitaskQA
|
| 28 |
+
from transformers import RobertaTokenizerFast
|
| 29 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 30 |
+
model = RobertaForMultitaskQA.from_pretrained(
|
| 31 |
+
"shahrukhx01/roberta-base-squad2-boolq-baseline",
|
| 32 |
+
task_labels_map={"squad_v2": 2, "boolq": 3},
|
| 33 |
+
).to(device)
|
| 34 |
+
tokenizer = RobertaTokenizerFast.from_pretrained("shahrukhx01/roberta-base-squad2-boolq-baseline")
|
| 35 |
+
```
|