Doc styler examples (#14953)
* Fix bad examples * Add black formatting to style_doc * Use first nonempty line * Put it at the right place * Don't add spaces to empty lines * Better templates * Deal with triple quotes in docstrings * Result of style_doc * Enable mdx treatment and fix code examples in MDXs * Result of doc styler on doc source files * Last fixes * Break copy from
This commit is contained in:
@@ -75,8 +75,8 @@ For more information, please refer to the official [paper](https://arxiv.org/pdf
|
||||
trained and should be used as follows:
|
||||
|
||||
```python
|
||||
input_ids = tokenizer.encode('This is a sentence from [MASK] training data', return_tensors='pt')
|
||||
mlm_labels = tokenizer.encode('This is a sentence from the training data', return_tensors='pt')
|
||||
input_ids = tokenizer.encode("This is a sentence from [MASK] training data", return_tensors="pt")
|
||||
mlm_labels = tokenizer.encode("This is a sentence from the training data", return_tensors="pt")
|
||||
|
||||
loss = model(input_ids, labels=input_ids, masked_lm_labels=mlm_labels)[0]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user