Update README.md
Browse files
README.md
CHANGED
|
@@ -17,9 +17,9 @@ You can use these models directly with the `transformers` library starting from
|
|
| 17 |
pip install -U transformers>=4.48.0
|
| 18 |
```
|
| 19 |
|
| 20 |
-
Since
|
| 21 |
|
| 22 |
-
**⚠️ If your GPU supports it, we recommend using
|
| 23 |
|
| 24 |
```bash
|
| 25 |
pip install flash-attn
|
|
@@ -51,14 +51,14 @@ from transformers import pipeline
|
|
| 51 |
from pprint import pprint
|
| 52 |
pipe = pipeline(
|
| 53 |
"fill-mask",
|
| 54 |
-
model="
|
| 55 |
)
|
| 56 |
input_text = "He walked to the [MASK]."
|
| 57 |
results = pipe(input_text)
|
| 58 |
pprint(results)
|
| 59 |
```
|
| 60 |
|
| 61 |
-
**Note:**
|
| 62 |
|
| 63 |
#
|
| 64 |
|
|
|
|
| 17 |
pip install -U transformers>=4.48.0
|
| 18 |
```
|
| 19 |
|
| 20 |
+
Since ModBERTBr is a Masked Language Model (MLM), you can use the `fill-mask` pipeline or load it via `AutoModelForMaskedLM`. To use ModBERTBr for downstream tasks like classification, retrieval, or QA, fine-tune it following standard BERT fine-tuning recipes.
|
| 21 |
|
| 22 |
+
**⚠️ If your GPU supports it, we recommend using ModBERTBr with Flash Attention 2 to reach the highest efficiency. To do so, install Flash Attention as follows, then use the model as normal:**
|
| 23 |
|
| 24 |
```bash
|
| 25 |
pip install flash-attn
|
|
|
|
| 51 |
from pprint import pprint
|
| 52 |
pipe = pipeline(
|
| 53 |
"fill-mask",
|
| 54 |
+
model="wallacelw/ModBERTBr",
|
| 55 |
)
|
| 56 |
input_text = "He walked to the [MASK]."
|
| 57 |
results = pipe(input_text)
|
| 58 |
pprint(results)
|
| 59 |
```
|
| 60 |
|
| 61 |
+
**Note:** ModBERTBr does not use token type IDs, unlike some earlier BERT models. Most downstream usage is identical to standard BERT models on the Hugging Face Hub, except you can omit the `token_type_ids` parameter.
|
| 62 |
|
| 63 |
#
|
| 64 |
|