MariaFjodorowa commited on
Commit
6e9c464
·
verified ·
1 Parent(s): 44ea6dd

Updating README with clean_up_tokenization_spaces

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