Updating README with clean_up_tokenization_spaces
Browse files
README.md
CHANGED
@@ -32,7 +32,7 @@ Every model uses its own tokenizer trained on language-specific HPLT data.
|
|
32 |
|
33 |
[The training statistics of all runs](https://api.wandb.ai/links/ltg/kduj7mjn)
|
34 |
|
35 |
-
## Example usage
|
36 |
|
37 |
This model currently needs a custom wrapper from `modeling_ltgbert.py`, you should therefore load the model with `trust_remote_code=True`.
|
38 |
|
@@ -49,7 +49,7 @@ output_p = model(**input_text)
|
|
49 |
output_text = torch.where(input_text.input_ids == mask_id, output_p.logits.argmax(-1), input_text.input_ids)
|
50 |
|
51 |
# should output: '[CLS] It's a beautiful place.[SEP]'
|
52 |
-
print(tokenizer.decode(output_text[0].tolist()))
|
53 |
```
|
54 |
|
55 |
The following classes are currently implemented: `AutoModel`, `AutoModelMaskedLM`, `AutoModelForSequenceClassification`, `AutoModelForTokenClassification`, `AutoModelForQuestionAnswering` and `AutoModeltForMultipleChoice`.
|
|
|
32 |
|
33 |
[The training statistics of all runs](https://api.wandb.ai/links/ltg/kduj7mjn)
|
34 |
|
35 |
+
## Example usage (tested with `transformers==4.46.1` and `tokenizers==0.20.1`)
|
36 |
|
37 |
This model currently needs a custom wrapper from `modeling_ltgbert.py`, you should therefore load the model with `trust_remote_code=True`.
|
38 |
|
|
|
49 |
output_text = torch.where(input_text.input_ids == mask_id, output_p.logits.argmax(-1), input_text.input_ids)
|
50 |
|
51 |
# should output: '[CLS] It's a beautiful place.[SEP]'
|
52 |
+
print(tokenizer.decode(output_text[0].tolist(), clean_up_tokenization_spaces=True))
|
53 |
```
|
54 |
|
55 |
The following classes are currently implemented: `AutoModel`, `AutoModelMaskedLM`, `AutoModelForSequenceClassification`, `AutoModelForTokenClassification`, `AutoModelForQuestionAnswering` and `AutoModeltForMultipleChoice`.
|